# Non realtime aspects of ES

**URL:** <https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387>\
**Category:** Elasticsearch\
**Created:** [November 4, 2017, 6:39pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387 "2017-11-04T18:39:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![iitgrad](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iitgrad](https://discuss.elastic.co/u/iitgrad)\
**Post date:** [November 4, 2017, 6:39pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/1 "2017-11-04T18:39:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 4, 2017, 7:17pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/2 "2017-11-04T19:17:17Z")

</div>

This is expected. This is how refresh works.

You can wait for the next refresh if needed with refresh=wait\_for

See [https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-refresh.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docs-refresh.html)

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 4, 2017, 8:47pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/3 "2017-11-04T20:47:26Z")

</div>

[https://www.elastic.co/guide/en/elasticsearch/guide/2.x/inside-a-shard.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/inside-a-shard.html) has a good background on this.

---

<div class="post-metadata">

**Author:** ![iitgrad](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iitgrad](https://discuss.elastic.co/u/iitgrad)\
**Post date:** [November 4, 2017, 10:52pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/4 "2017-11-04T22:52:33Z")

</div>

Thanks. I’ll read up on this.

---

<div class="post-metadata">

**Author:** ![iitgrad](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@iitgrad](https://discuss.elastic.co/u/iitgrad)\
**Post date:** [November 4, 2017, 10:58pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/5 "2017-11-04T22:58:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 2, 2017, 10:58pm UTC](https://discuss.elastic.co/t/non-realtime-aspects-of-es/106387/6 "2017-12-02T22:58:48Z")

</div>

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