Package org.apache.geode.cache.lucene
Interface LuceneIndexFactory
public interface LuceneIndexFactory
A factory for creating a lucene index on the current member. Obtain a factory from
LuceneService.createIndexFactory().
Configure the index using the add methods, and then call create(String, String) to
create the index.-
Method Summary
Modifier and TypeMethodDescriptionAdd a field to be indexedAdd a field to be indexed, using the specified analyzer.voidCreate the index on this member.Set the list of fields to be indexed.Set the list of fields to be indexed.setLuceneSerializer(LuceneSerializer luceneSerializer) Configure the way objects are converted to lucene documents for this lucene index
-
Method Details
-
addField
Add a field to be indexed- Parameters:
name- A field of the object to index. Only fields listed here will be stored in the index. Fields should map to PDX fieldNames if the object is serialized with PDX, or to java fields on the object otherwise. The special field nameLuceneService.REGION_VALUE_FIELDindicates that the entire value should be stored as a single field in the index.- Returns:
- this factory
-
setFields
Set the list of fields to be indexed.- Parameters:
fields- Fields of the object to index. Only fields listed here will be stored in the index. Fields should map to PDX fieldNames if the object is serialized with PDX, or to java fields on the object otherwise. The special field nameLuceneService.REGION_VALUE_FIELDindicates that the entire value should be stored as a single field in the index.- Returns:
- this factory
-
addField
Add a field to be indexed, using the specified analyzer.- Parameters:
name- A field of the object to index. Only fields listed here will be stored in the index. Fields should map to PDX fieldNames if the object is serialized with PDX, or to java fields on the object otherwise. The special field nameLuceneService.REGION_VALUE_FIELDindicates that the entire value should be stored as a single field in the index.analyzer- The analyzer to use for this this field. Analyzers are used by Lucene to tokenize your field into individual words.- Returns:
- this factory
-
setFields
Set the list of fields to be indexed.- Parameters:
fieldMap- Fields of the object to index, with the analyzer to be used for each field. Only fields listed here will be stored in the index. Fields should map to PDX fieldNames if the object is serialized with PDX, or to java fields on the object otherwise. The special field nameLuceneService.REGION_VALUE_FIELDindicates that the entire value should be stored as a single field in the index.- Returns:
- this factory
-
create
Create the index on this member.- Parameters:
indexName- name of the index.regionPath- The region to index. The entries added to this region will be indexes.
-
setLuceneSerializer
Configure the way objects are converted to lucene documents for this lucene index- Parameters:
luceneSerializer- A callback which converts a region value to a lucene document or documents to be stored in the index.- Returns:
- this factory
- Since:
- Geode 1.4
-