# Composite aggregations track\_total\_hits

**URL:** <https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500>\
**Category:** Elasticsearch\
**Created:** [May 10, 2019, 6:57am UTC](https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500 "2019-05-10T06:57:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![klaus82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klaus82/32/45900_2.png) [@klaus82](https://discuss.elastic.co/u/klaus82)\
**Post date:** [May 10, 2019, 6:57am UTC](https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500/1 "2019-05-10T06:57:21Z")

</div>

Hi all,

For me is not clear what are the differences and when use: **track\_total\_hits** , **search.max\_buckets** and **size** in particular for composite aggregations.  
Can someone help?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![BenTrent](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bentrent/32/33915_2.png) [@BenTrent](https://discuss.elastic.co/u/BenTrent)\
**Post date:** [May 10, 2019, 2:54pm UTC](https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500/2 "2019-05-10T14:54:48Z")

</div>

Heya @klaus82

`track_total_hits` only refers to document search hits. It does not change the behavior of a given composite aggregation. Additionally, it does not provide an accurate way to determine how many buckets will be within the composite aggregation.

`search.max_buckets` is a setting that restricts the maximum number of buckets that can be returned via a multi-bucket aggregation. When it comes to composite aggregations, it is a limit on the `size` parameter. This prevents too many buckets being gathered in a single composite aggregation "page".

`size` (in the composite aggregation context) is how many buckets are gathered per "page". This restricts the aggregation to only gather that number of buckets per "page".

---

<div class="post-metadata">

**Author:** ![klaus82](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/klaus82/32/45900_2.png) [@klaus82](https://discuss.elastic.co/u/klaus82)\
**Post date:** [May 12, 2019, 1:07pm UTC](https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500/3 "2019-05-12T13:07:44Z")

</div>

Thank you very much @BenTrent. Your explanation is very clear!

---

<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:** [June 9, 2019, 1:08pm UTC](https://discuss.elastic.co/t/composite-aggregations-track-total-hits/180500/4 "2019-06-09T13:08:02Z")

</div>

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