# Rerun ForceMerge When Already At 1 Segment per Shard?

**URL:** <https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875>\
**Category:** Elasticsearch\
**Created:** [February 28, 2017, 9:14pm UTC](https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875 "2017-02-28T21:14:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrmt](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mrmt](https://discuss.elastic.co/u/mrmt)\
**Post date:** [February 28, 2017, 9:14pm UTC](https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875/1 "2017-02-28T21:14:31Z")

</div>

Is it possible to some how rerun a force\_merge?

We have been force merging our data, however we recently learned about setting "index.codec" to "best\_compression" to potentially gain space from an index.

However since we have already force\_merged to 1 segment per shard, we cant force\_merge again to take advantage of the codec.

We are on 5.2.1. My friend who told me about "index.codec" is on 2.3.x and said they were able to rerun forcemerging even though the index had been merged down to 1 segment/shard.

I tried raising the max\_num\_segments but that didnt work, since it was the max, not the min.

Is the only way out of this to reindex?

---

<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:** [February 28, 2017, 10:26pm UTC](https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875/2 "2017-02-28T22:26:57Z")

</div>

You can rerun it even with a single segment 🙂

---

<div class="post-metadata">

**Author:** ![mrmt](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@mrmt](https://discuss.elastic.co/u/mrmt)\
**Post date:** [February 28, 2017, 10:43pm UTC](https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875/3 "2017-02-28T22:43:07Z")

</div>

Hey Mark,  
I did rerun it with max\_num\_segments=1 and it returned instantly. I figured it would have tried to recompress though?

Order of events:

1. `_forcemerge?max_num_segments=1` on index (this took some time and was run some time ago)
2. close index
3. set index.codec to best\_compression
4. open index
5. rerun `_forcemerge?max_num_segments=1` on index (returns instantly, no change to index size or anything else)

I was expecting _something_ to happen on the second running of the forcemerge. My friend said their indices fully reran and shrunk by at least 20%. I know everyones clsuter and data is different. But expected something to happen lol.

---

<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:** [March 28, 2017, 10:43pm UTC](https://discuss.elastic.co/t/rerun-forcemerge-when-already-at-1-segment-per-shard/76875/4 "2017-03-28T22:43:16Z")

</div>

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