# How to clear docs.deleted from cat-indices page of elasticsearch?

**URL:** <https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638>\
**Category:** Elasticsearch\
**Created:** [November 7, 2017, 7:59am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638 "2017-11-07T07:59:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditi\_Shah](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@Aditi\_Shah](https://discuss.elastic.co/u/Aditi_Shah)\
**Post date:** [November 7, 2017, 7:59am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/1 "2017-11-07T07:59:05Z")

</div>

There are a few document IDs that were rejected by elasticsearch and were added on the docs.deleted section of es. I have fixed the issue with those document IDs. My logstash is still reading the data and in es, instead of increasing doc count it is increasing the docs.deleted count. I used Curl to check those doc ID and output says {"found":false}.

I need to read those document IDs. Is there any way where i can clear the docs.deleted section?

Given below is a snapshot of my es cat-index:

yellow open posdata 74WTmacrRKeyBXMHuiUxgw 5 1 2172567 122443 3.6gb 3.6gb

I have also posted this question on stack overflow  
Link: [[https://stackoverflow.com/q/47152075/7496485](https://stackoverflow.com/q/47152075/7496485)]  
([https://stackoverflow.com/q/47152075/7496485](https://stackoverflow.com/q/47152075/7496485))

P.S. I am using ELK 5.6x

---

<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:** [November 7, 2017, 8:05am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/2 "2017-11-07T08:05:18Z")

</div>

Delete docs may be ones that have been updated. The only way to clear them is by waiting for an automatic merge or to run a force merge.

FYI we’ve renamed ELK to the Elastic Stack, otherwise Beats and APM feel left out! 😉

---

<div class="post-metadata">

**Author:** ![Aditi\_Shah](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@Aditi\_Shah](https://discuss.elastic.co/u/Aditi_Shah)\
**Post date:** [November 7, 2017, 8:20am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/3 "2017-11-07T08:20:46Z")

</div>

How to run a force merge?  
What is this Automatic merge?

BTW, I never updated these \_ids. They went to docs.deleted because there was some issues with the data and es rejected them. But I have fixed the issue but it still goes to docs.deleted.

Noted: Elastic Stack. 🙂

@warkolm

---

<div class="post-metadata">

**Author:** ![Aditi\_Shah](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@Aditi\_Shah](https://discuss.elastic.co/u/Aditi_Shah)\
**Post date:** [November 7, 2017, 10:45am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/4 "2017-11-07T10:45:44Z")

</div>

@warkolm I tried force merge. This was my output:  
{  
"\_shards" : {  
"total" : 10,  
"successful" : 5,  
"failed" : 0  
}  
}

but there has been no change on my docs.deleted row.

yellow open posdata 74WTmacrRKeyBXMHuiUxgw 5 1 2172567 122443 3.5gb 3.5gb

---

<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:** [November 7, 2017, 10:52am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/5 "2017-11-07T10:52:22Z")

</div>

Did you specify `max_num_segments` when you performed the force merge, e.g. `POST /posdata/_forcemerge?max_num_segments=1` ?

---

<div class="post-metadata">

**Author:** ![Aditi\_Shah](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@Aditi\_Shah](https://discuss.elastic.co/u/Aditi_Shah)\
**Post date:** [November 7, 2017, 11:43am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/6 "2017-11-07T11:43:35Z")

</div>

@Christian_Dahlqvist This worked. Thank you 🙂

---

<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:** [December 5, 2017, 11:43am UTC](https://discuss.elastic.co/t/how-to-clear-docs-deleted-from-cat-indices-page-of-elasticsearch/106638/7 "2017-12-05T11:43:42Z")

</div>

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