# Size of results on bucket for aggs

**URL:** <https://discuss.elastic.co/t/size-of-results-on-bucket-for-aggs/139620>\
**Category:** Elasticsearch\
**Created:** [July 11, 2018, 4:49pm UTC](https://discuss.elastic.co/t/size-of-results-on-bucket-for-aggs/139620 "2018-07-11T16:49:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Omar\_Verduzco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omar_verduzco/32/46183_2.png) [@Omar\_Verduzco](https://discuss.elastic.co/u/Omar_Verduzco)\
**Post date:** [July 11, 2018, 4:49pm UTC](https://discuss.elastic.co/t/size-of-results-on-bucket-for-aggs/139620/1 "2018-07-11T16:49:51Z")

</div>

Hi, I'm trying to get a simple aggregation, but looks like the size of the results in the bucket is always limited to 10, I haven't found a way to increase this, I'd like to have all the distinct elements returned. Here's my query, basically built from the documentation: [https://www.elastic.co/guide/en/elasticsearch/guide/current/\_scoping\_aggregations.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/_scoping_aggregations.html)

```
POST users/_search
{
  "size": 0, 
  "aggs": {
    "distinct_users": {
      "terms": {
        "field": "country"
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![Omar\_Verduzco](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omar_verduzco/32/46183_2.png) [@Omar\_Verduzco](https://discuss.elastic.co/u/Omar_Verduzco)\
**Post date:** [July 11, 2018, 5:02pm UTC](https://discuss.elastic.co/t/size-of-results-on-bucket-for-aggs/139620/2 "2018-07-11T17:02:24Z")

</div>

Didn't find any documentation about this, but I got lucky and found the solution, just add "size" under "terms" like this:

POST users/\_search  
{  
"size": 0,  
"aggs": {  
"distinct\_users": {  
"terms": {  
"size": 20  
"field": "country"  
}  
}  
}  
}

---

<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:** [August 8, 2018, 5:02pm UTC](https://discuss.elastic.co/t/size-of-results-on-bucket-for-aggs/139620/3 "2018-08-08T17:02:26Z")

</div>

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