Reputation: 1
I am wondering if it is possible to set the write consistency of all of the documents, or on a per document basis, within the body of a bulk request (either with NEST or ES JSON)? My code is currently using:
bulkDescriptor.Consistency(Consistency.All);
This generates a JSON request that sets the write consistency with an argument in the URI. The problem is my host is stripping off the query string at the end of the URI, so the write consistency setting is removed. I need a way to set the write consistency through the body of the JSON request.
Upvotes: 0
Views: 320
Reputation: 125518
consistency
can only be set on the query string; there is no body representation for consistency in Elasticsearch. Here's the source for Elasticsearch 2.3:
String consistencyLevel = request.param("consistency");
if (consistencyLevel != null) {
bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
}
Upvotes: 0