Non realtime aspects of ES

I notice that if I update a document in ES and then immediately query, the change is not reflected. If I query a 2nd time, say 500ms later, the change is reflected. Is this expected behavior? If so, is there a way I can get a callback from ES using the elasticsearch NPM module that only calls me back with success or failure once the change is permanent and queriable by subsequent queries?

This is expected. This is how refresh works.

You can wait for the next refresh if needed with refresh=wait_for

See has a good background on this.

Thanks. I’ll read up on this.

Awesome, thanks Mark. I’ll check this out.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.