6

I have upgraded to ElasticSearch.Net /Nest 2.0.2 and I can no longer use the low level client method (connector.GetClient().Raw.Bulk()). I have looked at the documentation but I can't seem to find any that shows how to post raw json using the new version to index new documents.

Imran Azad
  • 1,008
  • 2
  • 12
  • 30
  • Same here, using 2.0.4 version, and I am running into problems, in case you have figured by now, could you please post it – cmrhema Mar 19 '16 at 16:28

2 Answers2

3

That how I do that:

var client = new Elasticsearch.Net.ElasticLowLevelClient();
var result = client.Index<object>("index", "type", "id", new Elasticsearch.Net.PostData<object>("{\"name\":\"value\"}"));
Sławomir Rosiek
  • 4,038
  • 3
  • 25
  • 43
2

client.Raw.Bulk() turned into client.LowLevel.Bulk(). With NEST, you could 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);
Paul Lambert
  • 420
  • 3
  • 10