The ElasticSearch add-on allows you to configure, inject and use ElasticSearch clients.

Show version
dependencies {

Main features:

  • Embedded indexes,
  • Remote indexes.

More information about the ElasticSearch Java API here


To access an ElasticSearch index, you need to declare a client in configuration. Multiple clients can be configured. They must be listed in the following property:

org.seedstack.elasticsearch.clients = client1, client2, ...

Remote instance

To access a remote ElasticSearch index, you need to specify the host(s) of one or more node(s) of the ElasticSearch cluster:

hosts = host1:port1, host2:port2, ...

You can omit the port in which case will be set to the ElasticSearch default (9300).

Embedded instance

If you don’t specify the hosts property, a local ElasticSearch node will be created and stored in the persistence-elasticsearch/{client-name} subdirectory of the Seed local storage location, where {client-name} is the name of the ElasticSearch client.

Other options

You can specify any configuration property of the ElasticSearch client with the following syntax:

[org.seedstack.elasticsearch.client.client1] = value


To use a configured ElasticSearch client, simply inject it where needed:

Client client1;


Configuration for an embedded ElasticSearch instance:

org.seedstack.elasticsearch.clients = test

[org.seedstack.elasticsearch.client.test] = test-cluster-1

To inject this configured client, use the following syntax:

Client testClient;