Available as of Camel 2.11
The ElasticSearch component allows you to interface with an ElasticSearch server.
Maven users will need to add the following dependency to their
pom.xml for this component:
The following options may be configured on the ElasticSearch endpoint. All are required to be set as either an endpoint URI parameter or as a header (headers override endpoint properties)
required, indicates the operation to perform
the name of the index to act against
the type of the index to act against
the TransportClient remote host ip to use Camel 2.12
the TransportClient remote port to use (defaults to 9300) Camel 2.12
The following ElasticSearch operations are currently supported. Simply set an endpoint URI option or exchange header with a key of "operation" and a value set to one of the following. Some operations also require other parameters or the message body to be set.
Map, String, byte or XContentBuilder content to index
adds content to an index and returns the content's indexId in the body
index id of content to retrieve
retrives the specified index and returns a GetResult object in the body
index id of content to delete
deletes the specified indexId and returns a DeleteResult object in the body
|a List or Collection of any type that is already accepted (XContentBuilder, Map, byte, String)||Since Camel 2.14, adds content to an index and return a List of the id of the successfully indexed documents in the body|
Below is a simple INDEX example
A client would simply need to pass a body message containing a Map to the route. The result body contains the indexId created.
For more information, see these resources
ElasticSearch Main Site
ElasticSearch Java API