# After expunge command still docs.deleted is not reducing

**URL:** <https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207>\
**Category:** Elasticsearch\
**Created:** [March 12, 2024, 6:27am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207 "2024-03-12T06:27:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [March 12, 2024, 6:27am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207/1 "2024-03-12T06:27:53Z")

</div>

HI Team,

In one of our index we are going to remove the docs.deleted documents,but after the execution still the docs.deleted is not reducing

health status index uuid pri rep docs.count docs.deleted store.size pri.store.size  
green open 193 uD67TWj2Sf2obEKw 5 1 44584203 **2284288** 578.9gb 288.8gb

curl -s -u 'en:pwd' -XPOST "[http://ip](http://ip):port/193/\_forcemerge?only\_expunge\_deletes=true&pretty"

After execution of above commands the docs.deleted is not reducing ,

Please suggest on this.

---

<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:** [March 12, 2024, 6:34am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207/2 "2024-03-12T06:34:53Z")

</div>

It looks like you overall have about 5% deleted documents in your index. According to [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/indices-forcemerge.html#forcemerge-api-query-params) expunging deletes only considers segments with over 10% (default) deleted documents.

Given that a forcemerge can be expensive, why are you looking to expunge these? Is the index no longer being updated?

---

<div class="post-metadata">

**Author:** ![Siva\_Karan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/siva_karan/32/54688_2.png) [@Siva\_Karan](https://discuss.elastic.co/u/Siva_Karan)\
**Post date:** [March 12, 2024, 9:49am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207/3 "2024-03-12T09:49:20Z")

</div>

we need the free disk space for the shard,

we are using the index regularly

---

<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:** [March 12, 2024, 9:52am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207/4 "2024-03-12T09:52:36Z")

</div>

> [@Siva\_Karan](#):
>
> we need the free disk space for the shard,

Why do you need to do this? It seems a relatively small portion of the documents are deleted. Forcemerging will increase disk usage before any is released. Do you have enough space to handle this?

I am not sure forcemerging this way is the best way. Have you followed the guidelines [in the docs](https://www.elastic.co/guide/en/elasticsearch/reference/8.12/tune-for-disk-usage.html)?

---

<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:** [April 9, 2024, 9:53am UTC](https://discuss.elastic.co/t/after-expunge-command-still-docs-deleted-is-not-reducing/355207/5 "2024-04-09T09:53:20Z")

</div>

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