# Search.max\_buckets limit error on 7.6.0 even after setting to 10000

**URL:** https://discuss.elastic.co/t/search-max-buckets-limit-error-on-7-6-0-even-after-setting-to-10000/292688
**Category:** Elasticsearch
**Created:** [December 22, 2021, 1:36pm UTC](https://discuss.elastic.co/t/search-max-buckets-limit-error-on-7-6-0-even-after-setting-to-10000/292688 "2021-12-22T13:36:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Nipun\_Tulsyan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nipun_tulsyan/32/99437_2.png) [@Nipun\_Tulsyan](https://discuss.elastic.co/u/Nipun_Tulsyan)
#### Post date: [December 22, 2021, 1:36pm UTC](https://discuss.elastic.co/t/search-max-buckets-limit-error-on-7-6-0-even-after-setting-to-10000/292688/1 "2021-12-22T13:36:19Z")

</div>

I am using a simple query with aggregation.  
GET testIndex/\_search

```auto
{
  "size": 0,
  "aggs": {
    "Name1": {
      "terms": {
        "field": "field1.keyword",
        "size": 10000
      }
    },
    "Name2":{
      "terms": {
        "field": "field2.keyword",
        "size": 10000
      }
    }
  }
}

```

Here for **Name2** aggregation bucket actual size is more than 10000. But since I am already limiting its length to 10000 from **size** parameter can anyone explain why I am still getting this error:

> Trying to create too many buckets. Must be less than or equal to: [10000] but was [10001]. This limit can be set by changing the [search.max\_buckets] cluster level setting.","max\_buckets":10000}},"status":503}

---

<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: [January 19, 2022, 1:36pm UTC](https://discuss.elastic.co/t/search-max-buckets-limit-error-on-7-6-0-even-after-setting-to-10000/292688/2 "2022-01-19T13:36:50Z")

</div>

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