In elastic search is a collection queryable while

2019-09-04 01:53发布

问题:

I'm using Nest to insert a list of 60k+ objects into elastic search, specifically calling client.IndexMany(list, indexName).

  1. As the list is inserted, is it query-able? or is it only query-able after the complete list is indexed?
  2. If its the former, is there a way to force it to only be query-able after the list is fully indexed?

回答1:

Ad1. The answer is no. Document isn't immediately available for search after indexing.

Definitive guide has really nice chapter why elasticsearch works this way. You should have a look on this answers for a quick explanation.

Ad2. To refresh your index call elasticClient.Refresh()

Hope this helps you.