# Get Distinct Values with More than 50000

**URL:** <https://discuss.elastic.co/t/get-distinct-values-with-more-than-50000/185162>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 11, 2019, 10:32am UTC](https://discuss.elastic.co/t/get-distinct-values-with-more-than-50000/185162 "2019-06-11T10:32:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevetso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stevetso/32/27438_2.png) [@stevetso](https://discuss.elastic.co/u/stevetso)\
**Post date:** [June 11, 2019, 10:32am UTC](https://discuss.elastic.co/t/get-distinct-values-with-more-than-50000/185162/1 "2019-06-11T10:32:53Z")

</div>

Hi,

I found an error if the unique count of a field over 50000.

Request to Elasticsearch failed: {"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: [50000] but was [50001]. This limit can be set by changing the [search.max\_buckets] cluster level setting.","max\_buckets":50000}},"status":503}

May I ask how can we get the distinct count of a field if the distinct count more than 50000?

Thanks.

Steve

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [June 13, 2019, 9:12am UTC](https://discuss.elastic.co/t/get-distinct-values-with-more-than-50000/185162/2 "2019-06-13T09:12:53Z")

</div>

Hi @stevetso,

Could you gives us some more details on how did you get this error?

Best regards

---

<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:** [July 11, 2019, 9:12am UTC](https://discuss.elastic.co/t/get-distinct-values-with-more-than-50000/185162/3 "2019-07-11T09:12:55Z")

</div>

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