# Latency "required" before query of new data?

**URL:** <https://discuss.elastic.co/t/latency-required-before-query-of-new-data/62776>\
**Category:** Elasticsearch\
**Created:** [October 12, 2016, 4:07am UTC](https://discuss.elastic.co/t/latency-required-before-query-of-new-data/62776 "2016-10-12T04:07:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YeeP](https://avatars.discourse-cdn.com/v4/letter/y/41988e/32.png) [@YeeP](https://discuss.elastic.co/u/YeeP)\
**Post date:** [October 12, 2016, 4:07am UTC](https://discuss.elastic.co/t/latency-required-before-query-of-new-data/62776/1 "2016-10-12T04:07:19Z")

</div>

I am performing an insert into elasticsearch using a promise to confirm it is complete, before I query the same index. I have had to set a timeout to allow elasticsearch to "catch up" or the query returns zero results. This is on a local development environment, so it is not like I am dealing with network latency or something related. Any ideas would be much appreciated.

---

<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:** [October 12, 2016, 5:49am UTC](https://discuss.elastic.co/t/latency-required-before-query-of-new-data/62776/2 "2016-10-12T05:49:17Z")

</div>

Have a look at [https://www.elastic.co/guide/en/elasticsearch/guide/2.x/near-real-time.html](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/near-real-time.html)

---

<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:** [July 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/latency-required-before-query-of-new-data/62776/3 "2017-07-05T22:13:11Z")

</div>

Closed on July 5, 2017, 10:13pm UTC


