Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
/**
   * Create a lucene index using default analyzer.
   */
  public LuceneIndex createIndex(String indexName, String regionName, String... fields);
  
  /**
   * Create a lucene index using specified analyzer per field
   */
  public LuceneIndex createIndex(String indexName, String regionName,  
      Map<String, Analyzer>Class<? extends Analyzer>> analyzerPerField);

  public void destroyIndex(LuceneIndex index);
 
  public LuceneIndex getIndex(String indexName, String regionName);
  
  public Collection<LuceneIndex> getAllIndexes();

  /**
   * Get a factory for building queries
   */ 
  public LuceneQueryFactory createLuceneQueryFactory();

...

Gfsh API

 

Code Block
// Create Index
gfsh> create lucene index --name=indexName --region=/orders --fields=customer,tagsfield=customer,tags
or
gfsh> create lucene index --name=indexName --region=/orders --field=customer --field=tags

// Create Index
gfsh> create lucene index --name=indexName --region=/orders --field=customer,tags --analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer,org.apache.lucene.analysis.bg.BulgarianAnalyzer

// Destory Index
gfsh> destroy lucene index --name=indexName --region=/orders

Execute Lucene query
gfsh> lucene query --regionName=/orders -queryStrings="" --limit=100 page-size=10

 

XML Configuration 

 

Code Block
<cache
    xmlns="http://schema.pivotal.io/gemfire/cache"
    xmlns:lucene="http://geode.incubator.apache.org/schema/lucene"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://schema.pivotal.io/gemfire/cache
        http://schema.pivotal.io/gemfire/cache/cache-9.0.xsd
        http://geode.incubator.apache.org/schema/lucene
        http://geode.incubator.apache.org/schema/lucene/lucene-1.0.xsd"
    version="9.0">

<region name="region">  
 <lucene:index name="luceneIndex">
             <lucene:field name="fieldName" analyzer="KeywordAnalyzerorg.apache.lucene.analysis.standard.StandardAnalyzer"/> 
 </lucene:index>
</region>

 

REST API

TBD - But using solr to provide a REST API might make a lot of sense

Spring Data GemFire Support

TBD - But the Searchable annotation described in this blog might be a good place to start.

Implementation Flowchart

 

...