# Refresh interval related query

**URL:** <https://discuss.elastic.co/t/refresh-interval-related-query/151048>\
**Category:** Elasticsearch\
**Created:** [October 4, 2018, 1:04pm UTC](https://discuss.elastic.co/t/refresh-interval-related-query/151048 "2018-10-04T13:04:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShiniIn](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@ShiniIn](https://discuss.elastic.co/u/ShiniIn)\
**Post date:** [October 4, 2018, 1:04pm UTC](https://discuss.elastic.co/t/refresh-interval-related-query/151048/1 "2018-10-04T13:04:54Z")

</div>

I am newbie in elastic search so this may sound trivial but i want to know more about the **refresh\_interval** as it seems to affect vertex retrieval in ES.

**_Interpretation 1:_**  
refresh\_interval is set to 1s(Default settings).  
Does this mean that newly inserted data will be available for search after 1s of committing the mutation **OR** if the index refresh will begin after 1s of commit?

**_Interpretation 2:_**  
When inserting a large set of vertices, say 10k vertices in a graph database with ES.  
After what time, the first inserted vertex would become available?

1. 1s after the insertion of the first vertex
2. 1s after the insertion of the last vertex
3. Reindexing will begin after 1s when insertion of all vertices is complete.
4. Reindexing is included within commit operation  
(Right now, i am able to fetch data as soon as i fetch and refresh\_interval of 1s seems to have no affect here but it fails if refresh\_interval is increased to 5s)

Questions:  
1.What is relation between refresh\_interval and reindexing process?  
2. What can be done with refresh\_interval to ensure that the data is retrieved successfully after insertion, allowing for delays(if any)?

---

<div class="post-metadata">

**Author:** ![s1monw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s1monw/32/3637_2.png) [@s1monw](https://discuss.elastic.co/u/s1monw)\
**Post date:** [October 12, 2018, 11:44am UTC](https://discuss.elastic.co/t/refresh-interval-related-query/151048/2 "2018-10-12T11:44:36Z")

</div>

when `_refresh` is called all documents added to elasticsearch prior to the refresh call are made visible such that subsequent searches to a refreshed shards will retrieve these document given they match a query. `refresh_interval` will just call `_refresh` every second in the background.

> 1.What is relation between refresh\_interval and reindexing process?

there is no different to index or reindex, the same principle applies

> 1. What can be done with refresh\_interval to ensure that the data is retrieved successfully after insertion, allowing for delays(if any)?

you can use the `?refresh=wait_for` option on the indexing side to ensure docs are visible once the indexing request returns see [?refresh | Elasticsearch Guide [6.4] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/docs-refresh.html#_literal_refresh_wait_for_literal_can_force_a_refresh)

---

<div class="post-metadata">

**Author:** ![ShiniIn](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@ShiniIn](https://discuss.elastic.co/u/ShiniIn)\
**Post date:** [October 29, 2018, 10:00am UTC](https://discuss.elastic.co/t/refresh-interval-related-query/151048/3 "2018-10-29T10:00:36Z")

</div>

Hi

Thanks for clearing.

---

<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:** [November 26, 2018, 10:00am UTC](https://discuss.elastic.co/t/refresh-interval-related-query/151048/4 "2018-11-26T10:00:39Z")

</div>

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