In our application, we are using Bulk insert option to upload the multiple JSON documents in single insert command using Elasticsearch.net. We faced two issues while using BulkAsync, which is:
- BulkAsync method won't support to insert more than 20000 documents in single bulk. Getting thread abort exception. But Bulk method supports it.
- If use BulkAsync method then some of the documents may missed while insert into ELK, but in Bulk the missing document count is very less compared to BulkAsync.
Please let us know what is difference between Bulk and BulkAsync method. Whether the above mentioned two issues are still existing while using BulkAsync or not?
In below, I had mentioned my code to understand more:
var node = new Uri("http://localhost:9200");
var config = new ConnectionConfiguration(node);
var client = new ElasticLowLevelClient(config);
// JSONcontents --> It contains the multiple JSON files
client.Bulk(indexName, typeName, JSONcontents);
client.BulkAsync(indexName, typeName, JSONcontents);