Versions Compared

Key

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

...

In the case of partitioned regions, the query must be sent out to all the primaries. The results will then need to be aggregated back together. Lucene search will use FunctionService to distribute query to primaries. 

Input to primaries

  1. Serialized Query
  2. CollectorManager to be used for local aggregation
  3. Result limit

Output from primaries

  1. Merged collector created from results of search on local bucket indexes.

 

PlantUML
 participant LuceneQuery
 participant FunctionService
 participant FunctionCollector
 participant CollectorManager
 participant M1_LuceneFunction
 participant M1_CollectorManager
 participant Index_1
 participant Index_2
 LuceneQuery -> FunctionService: Query
 activate FunctionService
 FunctionService --> M1_LuceneFunction : LuceneContext
 activate M1_LuceneFunction
 FunctionService --> M2_LuceneFunction: LuceneContext
 activate M2_LuceneFunction
 M1_LuceneFunction -> Index_1 : search(Collector_1)
 Index_1 -> M1_LuceneFunction : loaded Collector_1
 M1_LuceneFunction -> Index_2 : search(Collector_2)
 Index_2 -> M1_LuceneFunction : loaded Collector_2
 M1_LuceneFunction -> M1_CollectorManager : merge Collectors
 activate M1_CollectorManager
 M1_CollectorManager -> M1_LuceneFunction : merged Collector
 deactivate M1_CollectorManager
 activate FunctionCollector
 M1_LuceneFunction -> FunctionCollector:Collector_M1
 deactivate M1_LuceneFunction
 M2_LuceneFunction -> FunctionCollector:Collector_M2
 deactivate M2_LuceneFunction
 FunctionCollector -> CollectorManager : merge Collectors
 activate CollectorManager
 CollectorManager -> FunctionCollector : Final Collector
 deactivate CollectorManager
 FunctionCollector -> FunctionService : Final Collector
 deactivate FunctionCollector
 FunctionService -> LuceneQuery : QueryResults
 deactivate FunctionService

We are still investigating options for how to aggregate the data, see Text Search Aggregation Options.

In case of replicated regions, query will be sent to one of the members and get the results there. Aggregation will be handled in that member before returned to the caller. 


Result collection and paging

The ResultSet will support pagination mechanism to retrieve the results. All the keys are aggregated at the query executor node (client or peer); and getAll is used to fetch the values according to page size.

JMX MBean

 

A Lucene Service MBean is available and accessed through an ObjectName like:

 

GemFire:service=CacheService,name=LuceneService,type=Member,member=192.168.2.13(59583)<ec><v5>-1026

 

This MBean provides operations these operations:

Code Block
languagejava
titleLuceneServiceMBean API
/**
 * Returns an array of {@link LuceneIndexMetrics} for the {@link com.gemstone.gemfire.cache.lucene.LuceneIndex}
 * instances defined in this member
 *
 * @return an array of LuceneIndexMetrics for the LuceneIndexes defined in this member
 */
public LuceneIndexMetrics[] listIndexMetrics();

/**
 * Returns an array of {@link LuceneIndexMetrics} for the {@link com.gemstone.gemfire.cache.lucene.LuceneIndex}
 * instances defined on the input region in this member
 *
 * @param regionPath The full path of the region to retrieve
 *
 * @return an array of LuceneIndexMetrics for the LuceneIndex instances defined on the input region
 * in this member
 */
public LuceneIndexMetrics[] listIndexMetrics(String regionPath);

/**
 * Returns a {@link LuceneIndexMetrics} for the {@link com.gemstone.gemfire.cache.lucene.LuceneIndex}
 * with the input index name defined on the input region in this member.
 *
 * @param regionPath The full path of the region to retrieve
 * @param indexName The name of the index to retrieve
 *
 * @return a LuceneIndexMetrics for the LuceneIndex with the input index name defined on the input region
 * in this member.
 */
public LuceneIndexMetrics listIndexMetrics(String regionPath, String indexName);

 

A LuceneIndexMetrics data bean includes raw stat values like:

Code Block
titleLuceneIndexMetrics Sample
Region=/data2; index=full_index
	commitTime->107608255573
	commits->5999
	commitsInProgress->0
	documents->498
	queryExecutionTime->0
	queryExecutionTotalHits->0
	queryExecutions->0
	queryExecutionsInProgress->0
	updateTime->7313618780
	updates->6419
	updatesInProgress->0

Limitations include:

 

  • no rates or average latencies are available
  • no aggregation (which means no rollups across members in the GemFire -> Distributed MBean)