[CONF] Apache Camel ElasticSearch
willem jiang edited the page: ElasticSearch Comment: CAMEL-7681 ... Maven users will need to add the following dependency to their pom.xml for this component: Code Block xml dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format Code Block elasticsearch://clusterName[?options] ... operation message body description INDEX Map, String, byte[] or XContentBuilder content to index adds content to an index and returns the content's indexId in the body
[CONF] Apache Camel ElasticSearch
ElasticSearch Page edited by Robert Liguori Changes (1) ... {code} elasticsearch://[clusterName]?[options] elasticsearch://clusterName[?options] {code} ... Full Content ElasticSearch Component 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: dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format elasticsearch://clusterName[?options] if you want to run against a local (in JVM/classloader) ElasticSearch server, just set the clusterName value in the URI to "local". See the client guide for more details. Endpoint Options 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) name description operation required, indicates the operation to perform indexName the name of the index to act against indexType the type of the index to act against ip the TransportClient remote host ip to use Camel 2.12 port the TransportClient remote port to use (defaults to 9300) Camel 2.12 Message Operations 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. operation message body description INDEX Map, String, byte[] or XContentBuilder content to index adds content to an index and returns the content's indexId in the body GET_BY_ID index id of content to retrieve retrives the specified index and returns a GetResult object in the body DELETE index id of content to delete deletes the specified indexId and returns a DeleteResult object in the body Index Example Below is a simple INDEX example from("direct:index") .to("elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"); route from uri="direct:index" / to uri="elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"/ /route A client would simply need to pass a body message containing a Map to the route. The result body contains the indexId created. MapString, String map = new HashMapString, String(); map.put("content", "test"); String indexId = template.requestBody("direct:index", map, String.class); For more information, see these resources ElasticSearch Main Site ElasticSearch Java API See Also Configuring Camel Component Endpoint Getting Started Stop watching space | Change email notification preferences View Online | View Changes | Add Comment
[CONF] Apache Camel ElasticSearch
ElasticSearch Page edited by Ben ODay Comment: updated per CAMEL-6444 Changes (1) ... |indexName|the name of the index to act against |indexType|the type of the index to act against |ip|the TransportClient remote host ip to use *Camel 2.12* |port|the TransportClient remote port to use (defaults to 9300) *Camel 2.12* h3. Message Operations ... Full Content ElasticSearch Component 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: dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format elasticsearch://[clusterName]?[options] if you want to run against a local (in JVM/classloader) ElasticSearch server, just set the clusterName value in the URI to "local". See the client guide for more details. Endpoint Options 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) name description operation required, indicates the operation to perform indexName the name of the index to act against indexType the type of the index to act against ip the TransportClient remote host ip to use Camel 2.12 port the TransportClient remote port to use (defaults to 9300) Camel 2.12 Message Operations 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. operation message body description INDEX Map, String, byte[] or XContentBuilder content to index adds content to an index and returns the content's indexId in the body GET_BY_ID index id of content to retrieve retrives the specified index and returns a GetResult object in the body DELETE index id of content to delete deletes the specified indexId and returns a DeleteResult object in the body Index Example Below is a simple INDEX example from("direct:index") .to("elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"); route from uri="direct:index" / to uri="elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"/ /route A client would simply need to pass a body message containing a Map to the route. The result body contains the indexId created. MapString, String map = new HashMapString, String(); map.put("content", "test"); String indexId = template.requestBody("direct:index", map, String.class); For more information, see these resources ElasticSearch Main Site ElasticSearch Java API See Also Configuring Camel Component Endpoint Getting Started Stop watching space | Change email notification preferences View Online | View Changes | Add Comment
[CONF] Apache Camel ElasticSearch
ElasticSearch Page added by Ben ODay ElasticSearch Component 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: dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format elasticsearch://[clusterName]?[options] if you want to run against a local (in JVM/classloader) ElasticSearch server, just set the clusterName value in the URI to "local". See the client guide for more details. Endpoint Options 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) name description operation required, indicates the operation to perform indexName the name of the index to act against indexType the type of the index to act against Message Operations 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. operation message body description INDEX Map of content keys/values adds content to an index and returns the content's indexId in the body GET_BY_ID index id to retrieve returns a GetResult object in the body based on the specified indexId Index Example Below is a simple INDEX example from("direct:index") .to("elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"); route from uri="direct:index" / to uri="elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"/ /route A client would simply need to pass a body message containing a Map to the route. The result body contains the indexId created. HashMapString, String map = new HashMapString, String(); map.put("content", "test"); String indexId = (String) template.requestBody("direct:index", map); For more information, see these resources ElasticSearch Main Site ElasticSearch Java API See Also Configuring Camel Component Endpoint Getting Started Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel ElasticSearch
ElasticSearch Page edited by Babak Vahdat Changes (3) ... {code:java} HashMapString, String map = new HashMapString, String(); map.put(content, test); String indexId = (String) template.requestBody(direct:index, map); String indexId = template.requestBody(direct:index, map, String.class); {code} ... Full Content ElasticSearch Component 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: dependency groupIdorg.apache.camel/groupId artifactIdcamel-elasticsearch/artifactId versionx.x.x/version !-- use the same version as your Camel core version -- /dependency URI format elasticsearch://[clusterName]?[options] if you want to run against a local (in JVM/classloader) ElasticSearch server, just set the clusterName value in the URI to "local". See the client guide for more details. Endpoint Options 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) name description operation required, indicates the operation to perform indexName the name of the index to act against indexType the type of the index to act against Message Operations 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. operation message body description INDEX Map of content keys/values adds content to an index and returns the content's indexId in the body GET_BY_ID index id to retrieve returns a GetResult object in the body based on the specified indexId Index Example Below is a simple INDEX example from("direct:index") .to("elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"); route from uri="direct:index" / to uri="elasticsearch://local?operation=INDEXindexName=twitterindexType=tweet"/ /route A client would simply need to pass a body message containing a Map to the route. The result body contains the indexId created. MapString, String map = new HashMapString, String(); map.put("content", "test"); String indexId = template.requestBody("direct:index", map, String.class); For more information, see these resources ElasticSearch Main Site ElasticSearch Java API See Also Configuring Camel Component Endpoint Getting Started Change Notification Preferences View Online | View Changes | Add Comment