entzik entzik - 1 year ago 76
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download