Wondering about REST API difference between _cat/count vs _stats

Trying to understand why it seems that indicies/_stats doesn't return the proper numbers of docs as _cat/count/index and kibana discover does?

eg. finding these samples from a sample index with a simple REST API CLI wrapper:

$ esapi -g _cat/count/ebopsyslog.2019
1657484984 20:29:44 2993565
$ esapi -g ebopsyslog.2019/_stats | jq ._all.primaries.docs.count
$ esapi -g ebopsyslog.2019/_stats | jq . | grep 2993565

Counting via Kibana Discover I also finds 2,993,264 hits from this sample index, was expecting the same counts from both API calls...

Hints appreciated!

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