If I run:
GET /267/_search
{
"size": 0,
"query": {"match_all": {}}
}
I get:
"hits": {
"total": 21055,
But if I run
GET /_cat/indices/267?v
I get
health status index pri rep docs.count docs.deleted store.size pri.store.size
yellow open 267 5 1 891816 139508 66.1mb 66.1mb
The first one tells me that there are 21,055 documents in the index. The second one tells me there are 891,816 documents in the index.
Please can you help me understand the difference?
Ahh... I think the answer just dawned on me - I have nested objects - and I bet the _cat version is counting those hidden documents. Is there a way to make _cat only count the visible documents? Also, is the number of non-deleted documents = docs.count - docs.deleted?
Many Thanks.