This topic describes the VMware GemFire Search create command.

Note: VMware GemFire Search uses the Lucene name in syntax and APIs.

The create lucene index command creates a VMware GemFire Search index. For details about VMware GemFire Search, see VMware GemFire Search Integration.

Availability: Online. To use this command, you must be connected to a JMX Manager member in gfsh.

Syntax

create lucene index --name=value --region=value --field=value(,value)*
  [--analyzer=value(,value)*] [--serializer=value] [--group=value(,value)*]

Parameters

Name Description Default
‑‑name Required. Name of the index to create.  
‑‑region Required. Name and path of the region on which to define the index.  
‑‑field Required. Fields of the region values that are referenced by the index, specified as a comma-separated list. To treat the entire value as a single field, specify __REGION_VALUE_FIELD.  
‑‑analyzer Analyzers to extract terms from text, specified as a comma-separated list. If not specified, the default analyzer is used for all fields. If specified, the number of analyzers must exactly match the number of fields specified. When listing analyzers, use the keyword DEFAULT for any field that will use the default analyzer. Lucene StandardAnalyzer 
‑‑serializer Fully qualified class name of the serializer to be used with this index. The serializer must implement the LuceneSerializer interface. You can use the built-in org.apache.geode.cache.lucene.FlatFormatSerializer to index and search collections and nested fields. If not specified, the simple default serializer is used, which indexes and searches only the top level fields of the region objects. simple serializer 
‑‑group The index will be created on all the members in the specified member groups.  

Example Commands

gfsh>create lucene index --name=customerIndex --region=/Customer 
   --field=__REGION_VALUE_FIELD

gfsh>create lucene index --name=analyzerIndex --region=/Person 
     --field=name,email,address,revenue 
     --analyzer=DEFAULT,org.apache.lucene.analysis.core.KeywordAnalyzer,
                examples.MyCharacterAnalyzer,DEFAULT

Sample Output

gfsh>create lucene index --name=testIndex --region=testRegion
    --field=__REGION_VALUE_FIELD
               Member                  | Status
-------------------------------------- | ---------------------------------
192.168.1.23(server505:17200)<v1>:1025 | Successfully created lucene index

Additional gfsh Commands

For additional GemFire Search gfsh commands, see the following:

check-circle-line exclamation-circle-line close-line
Scroll to top icon