rgrove/node-elastical

How to tell when document is indexed

Closed this issue · 1 comments

When the callback from elasticalClient.index() runs, it seems the document has been submitted but not actually indexed yet. This makes running unit tests slightly difficult as we have to insert a setTimeout wait of about a second before running the test.

Is there a method for submitting a callback function that runs once the document is indexed and ready to be searched?

Setting the refresh option to true should cause ElasticSearch to index the document immediately, but beyond that I don't think there's anything we can do.