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

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:xxxx/_cat/indices?v then it returns me docs.deleted count as 0 (zero)

why?. any suggestions on this would be appreciated.

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

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

Thanks @spinscale for response.

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

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

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.

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

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.

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