Elasticsearch document count returned by _stats versus _count Elasticsearch document count returned by _stats versus _count elasticsearch elasticsearch

Elasticsearch document count returned by _stats versus _count


Actually, the docs.count you get back from the Indices stats API also includes the count of nested documents present in the index so it will always be greater or equals than the count you get back from the Count API, which only returns the count of top-level documents, i.e. documents that would be returned from a search query.

So, judging by the numbers you posted, it looks like your index contains documents with fields whose type is nested in the mapping. Sounds correct?