I have an ElasticSearch with index posts setted up. I'm pushing new documents to it from time to time.
I want ElasticSearch to reply to my queries only when all documents are indexed. How can I do that?
In ES 2, you can call the refresh API just after having indexed your new documents, but it's not advised to do it in production as it may decrease the performance of your cluster.
In ES5, you will be able to send your index queries with ?refresh=wait_for and ES will only respond when the new documents are ready to be searched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With