2

I'm using _bluk api. I know that Elasticsearch is indexing items in NRT fashion (near real time). That means the after I get the response 201 created for every item It dosen't mean they are available for search.

Is there any API that I can use to check that all my items were indexed and available for search ?

Mortalus
  • 10,574
  • 11
  • 67
  • 117

1 Answers1

3

Behind the scene following three things controls the indexing in elasticsearch.

  1. Replication: sync vs async, update all the replicas before sending the response is sync or update some of them after sending response to client is called async mode which is default as well. Detailed official doc can be found here

  2. Consistency: Update how many replica will be updated based on the setting which can be all, none and default(quorum aka majority). further reading

  3. Refresh interval: which is 1 sec default, which means document is available for searching.

When you get 201 and you have default setting means it's indexed(on majority of shards) but if you want to make sure your search query gets the latest data then you can use the wait_for param while sending the indexing request.

Amit
  • 30,756
  • 6
  • 57
  • 88