# If I search for more than 30days data getting the below error. Please advise where to change the "Search.max\_buckets" value?

**URL:** <https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694>\
**Category:** Elasticsearch\
**Created:** [May 13, 2022, 2:48pm UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694 "2022-05-13T14:48:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ARAVINTH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aravinth/32/105650_2.png) [@ARAVINTH](https://discuss.elastic.co/u/ARAVINTH)\
**Post date:** [May 13, 2022, 2:48pm UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694/1 "2022-05-13T14:48:31Z")

</div>

{  
"request": {},  
"response": {},  
"body": {  
"statusCode": 503,  
"error": "Service Unavailable",  
"message": "search\_phase\_execution\_exception",  
"attributes": {  
"error": {  
"root\_cause": ,  
"type": "search\_phase\_execution\_exception",  
"reason": "",  
"phase": "fetch",  
"grouped": true,  
"failed\_shards": ,  
"caused\_by": {  
"type": "too\_many\_buckets\_exception",  
"reason": "Trying to create too many buckets. Must be less than or equal to: [65535] but was [65536]. This limit can be set by changing the [search.max\_buckets] cluster level setting.",  
"max\_buckets": 65535  
}  
}  
}  
},  
"name": "Error",  
"req": {},  
"res": {}  
}

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [May 13, 2022, 3:00pm UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694/2 "2022-05-13T15:00:03Z")

</div>

Hi @ARAVINTH !!

Look this annswer: [elasticsearch - Elastic search aggregation query throwing exception - Stack Overflow](https://stackoverflow.com/a/60673355/18778181)

---

<div class="post-metadata">

**Author:** ![ARAVINTH](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aravinth/32/105650_2.png) [@ARAVINTH](https://discuss.elastic.co/u/ARAVINTH)\
**Post date:** [May 13, 2022, 5:03pm UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694/3 "2022-05-13T17:03:20Z")

</div>

Thank you. Issue is fixed now.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 16, 2022, 12:26am UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694/4 "2022-05-16T00:26:02Z")

</div>

Welcome to our community @ARAVINTH! 😃

A few pointers for any future threads you open;

- Please format your code/logs/config using the `</>` button, or markdown style back ticks. It helps to make things easy to read which helps us help you
- Please also don't just post a body of text/code/json with no other context.

---

<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 13, 2022, 12:26am UTC](https://discuss.elastic.co/t/if-i-search-for-more-than-30days-data-getting-the-below-error-please-advise-where-to-change-the-search-max-buckets-value/304694/5 "2022-06-13T00:26:05Z")

</div>

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