entzik entzik - 8 months ago 40
Java Question

Is there a way to specify write consistency level when using spring data's ElasticSearchTemplate?

when using the elastic search java client it is possible to specify the write consistency level and timeout for each query:

final IndexRequestBuilder indexRequestBuilder = client.prepareIndex("myIndex", "myType");

final XContentBuilder sourceBuilder = .....


I did not find an API to do the same with Spring Data's ElasticSearchTemplate.

Do you know if there is a way?


after checking with the spring folks at devoxx.be it looks like there isn't a way to specify write consistency and timeout per query with SpringData's ElasticSearchTemplate.