LuceneIndex (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache.lucene, interface: LuceneIndex

Package org.apache.geode.cache.lucene

# Interface LuceneIndex

public interface LuceneIndex

LuceneIndex represents the Lucene index created over the data stored in Apache Geode regions. The Lucene indexes are maintained automatically by Apache Geode whenever the entries are updated in the associated regions. Lucene Indexes are created using `LuceneService.createIndexFactory()` by specifying the Lucene index name, the region associated with the Lucene index and the fields on which the Lucene index is to be created.

Every Lucene index is uniquely identified by the index name and the name of the region associated with it. To obtain the LuceneIndex created over a region use `LuceneService.getIndex(String, String)`

LuceneIndexes are created using gfsh, xml, or the Java API using LuceneService `LuceneService.createIndexFactory()`. More information about LuceneIndex can be found at `LuceneService`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Map<String,org.apache.lucene.analysis.Analyzer>`
  `getFieldAnalyzers()`
  Returns a map containing the field name and the `Analyzer` used to tokenize the field.
  `String[]`
  `getFieldNames()`
  Returns a string array containing the fields on which the LuceneIndex was created.
  `LuceneSerializer`
  `getLuceneSerializer()`
  Return the `LuceneSerializer` associated with this index
  `String`
  `getName()`
  Returns the name of the LuceneIndex object.
  `String`
  `getRegionPath()`
  Returns the path of the region on which the LuceneIndex was created.
  `boolean`
  `isIndexingInProgress()`
  Returns a boolean value to indicate if reindexing is in progress.

- ## Method Details

  - ### getName

    String getName()
    Returns the name of the LuceneIndex object. This name is provided while creating the LuceneIndex using `LuceneService.createIndexFactory()` create method
    Returns:
      Name of the LuceneIndex

  - ### getRegionPath

    String getRegionPath()
    Returns the path of the region on which the LuceneIndex was created. The region name is provided while creating the LuceneIndex using `LuceneService.createIndexFactory()`
    Returns:
      Path of the region

  - ### getFieldNames

    String[] getFieldNames()
    Returns a string array containing the fields on which the LuceneIndex was created. These fields are assigned using the addField method while creating the LuceneIndex using `LuceneService.createIndexFactory()`
    Returns:
      String array containing the field names

  - ### getFieldAnalyzers

    Map<String,org.apache.lucene.analysis.Analyzer> getFieldAnalyzers()
    Returns a map containing the field name and the `Analyzer` used to tokenize the field. The analyzer to be used on a particular field is set in the addField method while creating the LuceneIndex using `LuceneService.createIndexFactory()`
    Returns:
      a map containing pairs of the indexed field name and the corresponding `Analyzer` being used on each indexed field.

  - ### getLuceneSerializer

    LuceneSerializer getLuceneSerializer()
    Return the `LuceneSerializer` associated with this index
    Returns:
      the `LuceneSerializer` associated with this index

  - ### isIndexingInProgress

    boolean isIndexingInProgress()
    Returns a boolean value to indicate if reindexing is in progress.
    Returns:
      a boolean value indicating indexing progress