Creating Indexes

Indexes can be created programmatically or by using xml.

The GemFire QueryService provides methods to create, list and remove the index.

For index creation methods, see QueryService.createIndex and QueryService.createKeyIndex.

Sample Code (Java)
QueryService qs = cache.getQueryService();
 qs.createIndex("myIndex", "status" , "/exampleRegion");
 qs.createKeyIndex("myKeyIndex", "id", "/exampleRegion");
Sample Code (XML)
<region name=>
 <region-attributes . . . >
 </region-attributes>
 <index name="myIndex">
 <functional from-clause="/exampleRegion" expression="status"/>
 </index>
 <index name="myPrimIndex">
 <primary-key field="id"/>
 </index>
 <entry>