# Refresh Interval Value for Read-only index

**URL:** <https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976>\
**Category:** Elasticsearch\
**Created:** [July 4, 2019, 9:44pm UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976 "2019-07-04T21:44:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)\
**Post date:** [July 4, 2019, 9:44pm UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/1 "2019-07-04T21:44:31Z")

</div>

Does it really matter what values we set in refresh\_interval for a read-only index? I'm re-indexing a huge index that contains legacy data and is never updated i.e read-only (RO).

Before re-indexing, in order to boost performance I'm setting `"refresh_interval": -1`. Once re-indexing is over, it is necessary for me to reset the refresh\_interval back to say `"30s"` or `"60s"`.

I'm wondering if not re-setting back to `30s` or `60s` will make any difference since this index isn't going to get any data post re-indexing.

ELK Stack Version: 5.5.1

---

<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:** [July 4, 2019, 10:21pm UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/2 "2019-07-04T22:21:52Z")

</div>

You can also keep it to -1 and call the refresh API explicitly.

---

<div class="post-metadata">

**Author:** ![martinr\_ubi](https://avatars.discourse-cdn.com/v4/letter/m/b5e925/32.png) [@martinr\_ubi](https://discuss.elastic.co/u/martinr_ubi)\
**Post date:** [July 5, 2019, 1:45am UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/3 "2019-07-05T01:45:16Z")

</div>

> [@sandeepkanabar](#):
>
> I'm wondering if not re-setting back to `30s` or `60s` will make any difference since this index isn't going to get any data post re-indexing.

Yes in theory you need to at least refresh it once when your done, unless something else did it for you. Thats why @dadoonet says you can leave it disabled but need to refresh it manually after.

---

<div class="post-metadata">

**Author:** ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)\
**Post date:** [July 5, 2019, 3:10am UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/4 "2019-07-05T03:10:28Z")

</div>

Thank you @martinr_ubi and @dadoonet for the succinct clarification.

---

<div class="post-metadata">

**Author:** ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)\
**Post date:** [July 5, 2019, 3:14am UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/5 "2019-07-05T03:14:30Z")

</div>

> [@martinr\_ubi](#):
>
> unless something else did it for you

So if i fire a `GET _cat/indices/<that_index_name>` does it get refreshed?

---

<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:** [July 5, 2019, 6:50am UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/6 "2019-07-05T06:50:37Z")

</div>

No. It does not call refresh.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [July 5, 2019, 9:11am UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/7 "2019-07-05T09:11:37Z")

</div>

For the benefit of future readers, in 7.0 and later the right thing to do in this case is to leave `index.refresh_interval` unset, thanks to the [new `index.search.idle.after` setting](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/index-modules.html#dynamic-index-settings). The default behaviour is now not to refresh indices that are not being searched, even if you are indexing into them.

Way back in 5.5.1, however, I think the best thing to do is as David suggests: leave it at `-1` and explicitly call `POST /index/_refresh` when you have finished indexing. I think you will also see no ill effects if you set it to a time like `30s` or `60s` (or even back to the default of `1s`) since Elasticsearch will skip refreshes on indices that have not changed since the last refresh.

---

<div class="post-metadata">

**Author:** ![sandeepkanabar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandeepkanabar/32/79399_2.png) [@sandeepkanabar](https://discuss.elastic.co/u/sandeepkanabar)\
**Post date:** [July 5, 2019, 12:01pm UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/8 "2019-07-05T12:01:07Z")

</div>

Excellent. Thank you for the additional details @DavidTurner

---

<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:** [August 2, 2019, 12:01pm UTC](https://discuss.elastic.co/t/refresh-interval-value-for-read-only-index/188976/9 "2019-08-02T12:01:09Z")

</div>

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