JBoss Community Archive (Read Only)

ModeShape 5

Elasticsearch

This was tested and developed against Elastic Search 2.1.0.

Overview

Another index provider that ModeShape includes is an Elasticsearch index provider. As obvious this provider uses Elasticsearch for index data. Usually Elasticsearch cluster resides outside of the Modeshape process and thus all communications are established via Elasticsearch public REST API.

Elasticsearch index provider supports all kinds of indexes defined by Modeshape, it is applicable for multiple columns and support full text search.

Configuration

Since Elasticsearch index provider operates as a 'client' of a remote Elasticsearch cluster the configuration itself is pretty simple and includes in general only 'address' where to lookup the Elasticsearch node. The full list of provider parameters are as follows:

  • classname a constant fully qualified name of the class that implements provider; it tells to Modeshape to activate provider - org.modeshape.jcr.index.EsIndexProvider;

  • host the address of the node running Elasticsearch; it might be ip address or domain name. default value localhost;

  • port the port number where Elasticsearch listens for connections. Default value is 9200.

In dependence of Modeshape usage there are two different formats for the index provider configurations.

JSON

To configure the local index provider in embedded (JSON) mode you need to add the following section:

"indexProviders" : {
  "local" : {
     "classname" : "org.modeshape.jcr.index.EsIndexProvider"
     "host" : "cluster.somewhere.org",
     "port" : 9300
  }
}

JBoss AS

In case of Modeshape running as JBoss AS susbsytem use the following format:

 <index-providers>
  <index-provider classname="org.modeshape.jcr.index.elasticsearch.EsIndexProvider" module="org.modeshape.index-provider.elasticsearch" host="localhost" port="9300"/>
</index-providers>

It is possible to skip the host and port parameters, which default to localhost and 9200 respectively.

Starting with ModeShape 5 you can replace the value of the classname attribute with the elasticsearch alias.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:12:58 UTC, last content change 2016-04-07 07:25:07 UTC.