LuceneIndexFactory (Apache Geode 1.13.3)
Date: 2021-06-22

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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `LuceneIndexFactory` | `addField(String name)` Add a field to be indexed
    `LuceneIndexFactory` | `addField(String name, org.apache.lucene.analysis.Analyzer analyzer)` Add a field to be indexed, using the specified analyzer.
    `void` | `create(String indexName, String regionPath)` Create the index on this member.
    `LuceneIndexFactory` | `setFields(Map<String,org.apache.lucene.analysis.Analyzer> fieldMap)` Set the list of fields to be indexed.
    `LuceneIndexFactory` | `setFields(String... fields)` Set the list of fields to be indexed.
    `LuceneIndexFactory` | `setLuceneSerializer(LuceneSerializer luceneSerializer)` Configure the way objects are converted to lucene documents for this lucene index

- - ### Method Detail

    - #### addField

          LuceneIndexFactory addField(String name)

      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 name `LuceneService.REGION_VALUE_FIELD` indicates that the entire value should be stored as a single field in the index.

    - #### setFields

          LuceneIndexFactory setFields(String... fields)

      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 name `LuceneService.REGION_VALUE_FIELD` indicates that the entire value should be stored as a single field in the index.

    - #### addField

          LuceneIndexFactory addField(String name,
                                      org.apache.lucene.analysis.Analyzer analyzer)

      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 name `LuceneService.REGION_VALUE_FIELD` indicates 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.

    - #### setFields

          LuceneIndexFactory setFields(Map<String,org.apache.lucene.analysis.Analyzer> fieldMap)

      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 name `LuceneService.REGION_VALUE_FIELD` indicates that the entire value should be stored as a single field in the index.

    - #### create

          void create(String indexName,
                      String regionPath)

      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

          LuceneIndexFactory setLuceneSerializer(LuceneSerializer luceneSerializer)

      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.
      Since:
        Geode 1.4