You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dalouuu <ph...@gmail.com> on 2016/09/29 17:04:05 UTC

Re: Elasticsearch component - bulk requests with ids

Hello,

Did you publish any patch ? I also need this feature. 

Regards,





--
View this message in context: http://camel.465427.n5.nabble.com/Elasticsearch-component-bulk-requests-with-ids-tp5760522p5788202.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Elasticsearch component - bulk requests with ids

Posted by dalouuu <ph...@gmail.com>.
After some digging in the code I managed to make it work. 
I am using camel-elasticsearch 2.16.2
It would be useful to others to add something about this in the
documentation page -

Here's how I did it : 

For each exchange containing a document to index I define the following
headers :
org.apache.camel.component.elasticsearch.ElasticsearchConstants.PARAM_INDEX_ID
(
org.apache.camel.component.elasticsearch.ElasticsearchConstants.PARAM_INDEX_NAME 
org.apache.camel.component.elasticsearch.ElasticsearchConstants.PARAM_INDEX_TYPE
org.apache.camel.component.elasticsearch.ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL
org.apache.camel.component.elasticsearch.ElasticsearchConstants.PARAM_REPLICATION_TYPE

I also put an IndexRequest object in my body by calling static method
org.apache.camel.component.elasticsearch.converter.ElasticsearchActionRequestConverter.toIndexRequest
([map of values to index], exchange)

Then I simply forward the exchange to
org.apache.camel.component.elasticsearch.aggregation.BulkRequestAggregationStrategy





--
View this message in context: http://camel.465427.n5.nabble.com/Elasticsearch-component-bulk-requests-with-ids-tp5760522p5788269.html
Sent from the Camel - Users mailing list archive at Nabble.com.