I am looking to get an accurate count of deleted Elasticsearch documents excluding the nested documents at Lucene level. I am aware of the following APIs to get document and deleted document counts but none of them return the information I need.
-
GET myindex/_count API
- Returns the top-level Elasticsearch documents. -
GET _cat/indices/myindex API
- Returnsdocs.count
&deleted.docs
that are taken directly from Lucene and include nested documents. -
GET _cat/count/myindex API
- Returns the top-level documents same as the 1st option.
For example: Suppose an index with 10
documents that are internally stored as 100
Lucene documents and I delete 5 documents, I want to get 5 instead of the count of deleted Lucene docs.
Is there a way to get the top-level deleted documents?