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.

Reply via email to