# Why does the field docs.deleted count returns as zero in elasticsearch \_cat/indices API response?

**URL:** <https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537>\
**Category:** Elasticsearch\
**Created:** [November 5, 2019, 7:34am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537 "2019-11-05T07:34:07Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santu/32/45072_2.png) [@Santu](https://discuss.elastic.co/u/Santu)\
**Post date:** [November 5, 2019, 7:34am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/1 "2019-11-05T07:34:07Z")

</div>

Hey,

I am using elasticsearch 5.X version. and i have created an index along with some documents.

POST /\_bulk  
{ "index" : { "\_index" : "index-a", "\_type" : "type-a", "\_id" : "1" } }  
{ "field" : "value1" }  
{ "create" : { "\_index" : "index-a", "\_type" : "type-a", "\_id" : "2" } }

and after that i have deleted 1 document from the above index.  
DELETE index-a/type-a/2

when i perform [http://localhost](http://localhost):xxxx/\_cat/indices?v then it returns me docs.deleted count as 0 (zero)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/679d9e80b1b96d7648943c24c5644506bd3fcc98.png)

why?. any suggestions on this would be appreciated.

---

<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:** [November 5, 2019, 9:48am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/2 "2019-11-05T09:48:04Z")

</div>

Is it possible that you executed a force merge before testing this?

```auto
POST /_bulk
{ "index" : { "_index" : "index-a", "_type" : "type-a", "_id" : "1" } }
{ "field" : "value1" }
{ "create" : { "_index" : "index-a", "_type" : "type-a", "_id" : "2" } }

DELETE index-a/type-a/2

# shows deleted document
GET /_cat/indices/index-a?v

POST index-a/_flush?force

# no more deleted document
GET /_cat/indices/index-a?v

```

---

<div class="post-metadata">

**Author:** ![Santu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santu/32/45072_2.png) [@Santu](https://discuss.elastic.co/u/Santu)\
**Post date:** [November 5, 2019, 10:12am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/3 "2019-11-05T10:12:58Z")

</div>

Thanks @spinscale for response.

No. but still the result is same before and after the force merge.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/7/672540e3d2bf6eeb134cfbec277c3c33f98d46dd.png)

---

<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:** [November 5, 2019, 10:17am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/4 "2019-11-05T10:17:33Z")

</div>

is there potentially another background process triggering this? Out of curiosity, why do you think this is a problem?

---

<div class="post-metadata">

**Author:** ![Santu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santu/32/45072_2.png) [@Santu](https://discuss.elastic.co/u/Santu)\
**Post date:** [November 5, 2019, 10:50am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/5 "2019-11-05T10:50:27Z")

</div>

exactly i'm not very sure if there is any other background process is preventing this from fetching the actual results. but i tested it on my local machine only.

actually i'm expecting some docs deleted count for that index at index level.

---

<div class="post-metadata">

**Author:** ![Santu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/santu/32/45072_2.png) [@Santu](https://discuss.elastic.co/u/Santu)\
**Post date:** [November 6, 2019, 7:17am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/6 "2019-11-06T07:17:41Z")

</div>

@spinscale, can you also please elaborate what does docs.deleted count means?

---

<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:** [November 6, 2019, 8:56am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/7 "2019-11-06T08:56:58Z")

</div>

`docs.deleted` is the count of documents marked as deleted, which will be physically removed from disk at some point in the future when merging happens.

---

<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 4, 2019, 8:57am UTC](https://discuss.elastic.co/t/why-does-the-field-docs-deleted-count-returns-as-zero-in-elasticsearch-cat-indices-api-response/206537/8 "2019-12-04T08:57:02Z")

</div>

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