Skip to content

Elasticsearch as an index store

karthikprasad13 edited this page Sep 8, 2017 · 5 revisions

Elasticseach can be used to store indexes of NoSQL database to perform faster aggregations.

Kundera supported NoSQL databases that can leverage Elasticsearch as an indexing store:

  • Cassandra
  • Hbase
  • MongoDB
  • Kudu
  • CouchDB
  • Oracle NoSQL
  • Redis

Note: Along with client dependency, Kundera-elastic-search dependency will be needed.

How to use

Step 1

In persistence.xml of a specific client, user needs to add the following -

<property name="kundera.indexer.class" value="com.impetus.client.es.index.ESIndexer"/>

Step 2

Add esindexer.xml file in classpath.

Step 3

Specify the fields with @IndexCollection annotation on which indexes are created.

Example:

@IndexCollection(columns = { @com.impetus.kundera.index.Index(name = "price") })
public class Product
{
     @Column(name = "Price")
     private int price;
}

All set for strong indexes in Elasticsearch.

Aggregation on NoSQL data using Kundera Elasticsearch

How to perform aggregation over data stored in NoSQL?

Clone this wiki locally