# Understanding forcemerge with only\_expunge\_deletes

**URL:** <https://discuss.elastic.co/t/understanding-forcemerge-with-only-expunge-deletes/383924>\
**Category:** Elasticsearch\
**Created:** [December 9, 2025, 10:56am UTC](https://discuss.elastic.co/t/understanding-forcemerge-with-only-expunge-deletes/383924 "2025-12-09T10:56:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ma\_br](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ma_br/32/145465_2.png) [@ma\_br](https://discuss.elastic.co/u/ma_br)\
**Post date:** [December 9, 2025, 10:56am UTC](https://discuss.elastic.co/t/understanding-forcemerge-with-only-expunge-deletes/383924/1 "2025-12-09T10:56:33Z")

</div>

My scenario is the following:

i have a live index with a lot of updates that runs out of disk space at some time.

The reason is that after some time i have a lot of max size segments (5gb) but the deleted document count is below 50% → The normal merge will not touch them.

My idea is: Can i rewrite the current segments without the deleted documents to give disk space free.

Can a forcemerge with “only\_expunge\_deletes=true” do the trick for me? Or will this create big segments that create more problems in the future?

the documentation is quite slim on what only\_expunge\_deletes will really do, e.g. [Force a merge | Elasticsearch API documentation](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge#forcemerge-api-query-params)

PS: i know the alternative is a complete reindex and deletion of the old index → but this is a quite ressource heavy approach

PS: The question was also asked here but nobody answered: [Safe usage of `_forcemerge` with `only_expunge_deletes`](https://discuss.elastic.co/t/safe-usage-of-forcemerge-with-only-expunge-deletes/321964)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [December 28, 2025, 6:33am UTC](https://discuss.elastic.co/t/understanding-forcemerge-with-only-expunge-deletes/383924/2 "2025-12-28T06:33:16Z")

</div>

> [@ma\_br](#):
>
> My idea is: Can i rewrite the current segments without the deleted documents to give disk space free.

Segments in Elsticsearch are immutable so no matter how you run forcemerge new segments will be created. Even if new segments are created it may be beneficial to run forcemerge the way you described, but be aware it will temporarily increase disk usage. I do not know the internals though and have rarely tried to tune merging so will need to leave that to someone else.

---

<div class="post-metadata">

**Author:** ![Wilsonhenrry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wilsonhenrry/32/146506_2.png) [@Wilsonhenrry](https://discuss.elastic.co/u/Wilsonhenrry)\
**Post date:** [December 29, 2025, 2:28am UTC](https://discuss.elastic.co/t/understanding-forcemerge-with-only-expunge-deletes/383924/3 "2025-12-29T02:28:17Z")

</div>

Hi all,

I have a live Elasticsearch index with heavy updates, and over time it starts running out of disk space. Many segments are already at max size (~5GB), but their deleted doc ratio is still below 50%, so normal merges don’t seem to clean them up.

I’m wondering if running `forcemerge` with `only_expunge_deletes=true` can help reclaim disk space by removing deleted documents without doing a full reindex.

Does this option simply rewrite existing segments to drop deletes, or can it create large segments that might cause problems later? Any practical guidance or caveats for using this on a live index would be helpful.

Thanks!
