0
votes

In the ElasticSearch documentation it specifies that you can set the consistency level when indexing.

https://www.elastic.co/guide/en/elasticsearch/client/net-api/1.x/bulk.html

However in the lastest version of the NEST client this has been removed (breaking change).

Is there a new way of doing this as it would seem that the documentation does not include anything regarding creating indexes or indexing data. The docs only contain query and aggregation text (unless I am mistaken).

https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/nest.html

I would like to index data into an index that has the consistency level of 'all'.

1

1 Answers

1
votes

Consistency is controlled by wait_for_active_shards, which was added in 5.0.0 (search for wait_for_active_shards)

var indexResponse = client.Index(new Message { Content = "demo" }, i => i
    .WaitForActiveShards("all")
);