Raw json post using elastic search client

I upgraded to ElasticSearch.Net/Nest 2.0.2, and I can no longer use the low-level client method (connector.GetClient (). Raw.Bulk ()). I looked through the documentation, but I can not find anything that shows how to send raw json using the new version to index new documents.

+5
source share
2 answers

How do i do this:

var client = new Elasticsearch.Net.ElasticLowLevelClient(); var result = client.Index<object>("index", "type", "id", new Elasticsearch.Net.PostData<object>("{\"name\":\"value\"}")); 
+2
source

client.Raw.Bulk () turned into client.LowLevel.Bulk (). With NEST, you can do something like:

 // jsonStringList assumed to hold your bulk indexing commands and objects var jsonPostData = new PostData<object>(jsonStringList); var response = nestClient.LowLevel.Bulk<VoidResponse>("your_index", "your_type", jsonPostData); 
+2
source

Source: https://habr.com/ru/post/1243070/


All Articles