# Aggregation with large data set using bucket aggregation

**URL:** <https://discuss.elastic.co/t/aggregation-with-large-data-set-using-bucket-aggregation/288141>\
**Category:** Elasticsearch\
**Created:** [November 1, 2021, 1:05pm UTC](https://discuss.elastic.co/t/aggregation-with-large-data-set-using-bucket-aggregation/288141 "2021-11-01T13:05:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RAVI\_GOPALANI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_gopalani/32/83691_2.png) [@RAVI\_GOPALANI](https://discuss.elastic.co/u/RAVI_GOPALANI)\
**Post date:** [November 1, 2021, 1:05pm UTC](https://discuss.elastic.co/t/aggregation-with-large-data-set-using-bucket-aggregation/288141/1 "2021-11-01T13:05:40Z")

</div>

Hi ,

We are using Elasticsearch to get the top hits based on large volumes of data using bucket aggregation. But we see there is default limit in max\_result\_window attribute of initial 10000 records which will be processed. We increase the size to 5000000. But looks like all records are not getting processed and returning first 10000 hits. As per requirement , we need to get top 20 hits from the give set of records based on aggregation results. Please let me know if there is any feasible solution.  
Waiting for your reply.

---

<div class="post-metadata">

**Author:** ![RAVI\_GOPALANI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravi_gopalani/32/83691_2.png) [@RAVI\_GOPALANI](https://discuss.elastic.co/u/RAVI_GOPALANI)\
**Post date:** [November 16, 2021, 8:01am UTC](https://discuss.elastic.co/t/aggregation-with-large-data-set-using-bucket-aggregation/288141/2 "2021-11-16T08:01:34Z")

</div>

can anyone help on this issue

---

<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:** [December 14, 2021, 8:01am UTC](https://discuss.elastic.co/t/aggregation-with-large-data-set-using-bucket-aggregation/288141/3 "2021-12-14T08:01:58Z")

</div>

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