# Term aggregation not return accurate number of records

**URL:** <https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142>\
**Category:** Elasticsearch\
**Created:** [February 22, 2018, 11:24pm UTC](https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142 "2018-02-22T23:24:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [February 22, 2018, 11:24pm UTC](https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142/1 "2018-02-22T23:24:07Z")

</div>

Hi There,

I am running ELasticSearch 6.0. i have a query with term aggregation to a "not-analyzed" field, but I am getting inaccurate count. i have set the size for aggregation to "100" as follows.

for example when set term aggregation for "title", i get

journal of biological chemistry (11)

but when explicitly search for "journal of biological chemistry" i get "14" records matching

```
"aggs": {
    
    "title": {
        "terms": {
            "field": "titlenav",
            "size": 100,
            "show_term_doc_count_error": true
        }
    }
}

```

Thanks

---

<div class="post-metadata">

**Author:** ![telebh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/telebh/32/42272_2.png) [@telebh](https://discuss.elastic.co/u/telebh)\
**Post date:** [February 28, 2018, 3:55pm UTC](https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142/2 "2018-02-28T15:55:02Z")

</div>

any update on this?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 28, 2018, 5:56pm UTC](https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142/3 "2018-02-28T17:56:17Z")

</div>

See shard\_size and explanation why here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-approximate-counts](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-approximate-counts)

---

<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:** [March 28, 2018, 5:56pm UTC](https://discuss.elastic.co/t/term-aggregation-not-return-accurate-number-of-records/121142/4 "2018-03-28T17:56:57Z")

</div>

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