# Elasticsearch aggregation size

**URL:** <https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046>\
**Category:** Elasticsearch\
**Created:** [August 21, 2019, 6:13am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046 "2019-08-21T06:13:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lakmina\_chathurya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lakmina_chathurya/32/45418_2.png) [@lakmina\_chathurya](https://discuss.elastic.co/u/lakmina_chathurya)\
**Post date:** [August 21, 2019, 6:13am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046/1 "2019-08-21T06:13:19Z")

</div>

When i use following query, it shows only 10 buckets as default

"aggs": {  
"group": {  
"terms": {  
"field": "user.keyword"  
}

when i need to get all buckets i used following query

"aggs": {  
"group": {  
"terms": {  
"field": "user.keyword",  
"size":100000  
}

Is there any way to get all the documents, without mention 10000.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 21, 2019, 6:42am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046/2 "2019-08-21T06:42:07Z")

</div>

if you need to go through all results of an aggregation, check out the [composite aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-aggregations-bucket-composite-aggregation.html), as otherwise you will run into the [max\_buckets limitation](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/search-aggregations-bucket.html)

---

<div class="post-metadata">

**Author:** ![lakmina\_chathurya](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lakmina_chathurya/32/45418_2.png) [@lakmina\_chathurya](https://discuss.elastic.co/u/lakmina_chathurya)\
**Post date:** [August 21, 2019, 7:20am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046/3 "2019-08-21T07:20:36Z")

</div>

@spinscale Thank you so much

---

<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:** [September 18, 2019, 7:20am UTC](https://discuss.elastic.co/t/elasticsearch-aggregation-size/196046/4 "2019-09-18T07:20:45Z")

</div>

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