# How is search.max\_buckets calculated? ES 7.5.0

**URL:** <https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610>\
**Category:** Elasticsearch\
**Created:** [February 17, 2021, 8:04pm UTC](https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610 "2021-02-17T20:04:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JonathanAaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathanaaron/32/24405_2.png) [@JonathanAaron](https://discuss.elastic.co/u/JonathanAaron)\
**Post date:** [February 17, 2021, 8:04pm UTC](https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610/1 "2021-02-17T20:04:00Z")

</div>

I'm wondering how `search.max_buckets` is calculated. I have a multilevel terms aggregation. We have 10,000 leaf node buckets. Do the parent buckets count as part of the 10,000 limit?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [February 17, 2021, 8:17pm UTC](https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610/2 "2021-02-17T20:17:50Z")

</div>

Parent buckets do count. Metric aggs don't. If you are willing to upgrade we've bumped the limit to 65535 and dropped it from all stages but the final reduce. Other than that we use real memory usage to limit. But you'd want to upgrade to get it.

---

<div class="post-metadata">

**Author:** ![JonathanAaron](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jonathanaaron/32/24405_2.png) [@JonathanAaron](https://discuss.elastic.co/u/JonathanAaron)\
**Post date:** [February 17, 2021, 9:11pm UTC](https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610/3 "2021-02-17T21:11:57Z")

</div>

Thank you, this helps.

---

<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 17, 2021, 9:12pm UTC](https://discuss.elastic.co/t/how-is-search-max-buckets-calculated-es-7-5-0/264610/4 "2021-03-17T21:12:38Z")

</div>

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