# Should I force merge after resetting refresh interval after indexing

**URL:** <https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590>\
**Category:** Elasticsearch\
**Created:** [August 1, 2018, 2:16pm UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590 "2018-08-01T14:16:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikrishna](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@srikrishna](https://discuss.elastic.co/u/srikrishna)\
**Post date:** [August 1, 2018, 2:16pm UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590/1 "2018-08-01T14:16:47Z")

</div>

I am doing bulk indexing and as an optimization I set the refresh\_interval of the indices to -1. I am going to set it back to the default after I am done. In one of the ES documents (perhaps old) I read I have to forcemerge. I don't see a need for it based on what I read about refresh\_interval, should I?

Thanks

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 2, 2018, 9:19am UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590/2 "2018-08-02T09:19:36Z")

</div>

You don't **have** to do it at all. You **can** do it, but you only **should** do it, if you do not have any further writes on that index - otherwise merges will happen anyway again over time.

See [https://www.elastic.co/guide/en/elasticsearch/reference/6.3/tune-for-search-speed.html#\_force\_merge\_read\_only\_indices](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/tune-for-search-speed.html#_force_merge_read_only_indices)

---

<div class="post-metadata">

**Author:** ![srikrishna](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@srikrishna](https://discuss.elastic.co/u/srikrishna)\
**Post date:** [August 2, 2018, 2:24pm UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590/3 "2018-08-02T14:24:42Z")

</div>

Mine is a time based index and after last write there aren't any writes. I didn't do force merge but just index refresh. I see possibly the last line I inserted (at least last line in my log feed) from the search. I say 'possibly' as there are other hits with search but the last one did show up. The index is large (about 1.6 TB) so don't want to force merge if I can get away not doing it.

So are you sure I have to force merge to see the results of insertion or are you saying it helps (usage of 'should' in your answer is confusing)?

I understand force merge makes searches faster/better on read only indices but that optimization is for another day.

Thanks for the reponse  
S

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 3, 2018, 7:07am UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590/4 "2018-08-03T07:07:58Z")

</div>

A refresh is perfectly fine to see the latest changes. You might want to run a flush, so that everything is persisted to disk, so recovery is going to be faster., in case it is needed.

---

<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 31, 2018, 7:08am UTC](https://discuss.elastic.co/t/should-i-force-merge-after-resetting-refresh-interval-after-indexing/142590/5 "2018-08-31T07:08:01Z")

</div>

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