# Are counts generally exact or approximate?

**URL:** <https://discuss.elastic.co/t/are-counts-generally-exact-or-approximate/135069>\
**Category:** Elasticsearch\
**Created:** [June 8, 2018, 1:18am UTC](https://discuss.elastic.co/t/are-counts-generally-exact-or-approximate/135069 "2018-06-08T01:18:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew\_rueckert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_rueckert/32/31974_2.png) [@andrew\_rueckert](https://discuss.elastic.co/u/andrew_rueckert)\
**Post date:** [June 8, 2018, 1:18am UTC](https://discuss.elastic.co/t/are-counts-generally-exact-or-approximate/135069/1 "2018-06-08T01:18:10Z")

</div>

I know that cardinality values and terms aggregation counts are approximate, because it's mentioned in the documentation. Should I assume that if a value is not explicitly called out as being an approximation, that it is exact? (`index/_count`, `index/_stats` doc-counts, search total-hits, etc.)

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [June 18, 2018, 6:12pm UTC](https://discuss.elastic.co/t/are-counts-generally-exact-or-approximate/135069/2 "2018-06-18T18:12:47Z")

</div>

> [@andrew\_rueckert](#):
>
> Should I assume that if a value is not explicitly called out as being an approximation, that it is exact? ( `index/_count` , `index/_stats` doc-counts, search total-hits, etc.)

This is correct. If something is expected to be approximate or potentially include error, we explicitly call that out. Otherwise you should be able to rely on counts to be accurate.

I think the only caveat are search hits. It's possible to have partial search results if one or more shard doesn't respond (for any number of reasons). I'm not sure if we call that out in the docs explicitly, but you can tell if the hits are "complete" or not by looking at the shards section in the search response. It will tell you how many shards were involved in the search, how many failed, etc.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 16, 2018, 6:12pm UTC](https://discuss.elastic.co/t/are-counts-generally-exact-or-approximate/135069/3 "2018-07-16T18:12:48Z")

</div>

Closed on July 16, 2018, 6:12pm UTC

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