# Why aggregation result return max results only 10

**URL:** <https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892>\
**Category:** Elasticsearch\
**Created:** [January 11, 2019, 11:31am UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892 "2019-01-11T11:31:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![examin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/examin/32/70688_2.png) [@examin](https://discuss.elastic.co/u/examin)\
**Post date:** [January 11, 2019, 11:31am UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/1 "2019-01-11T11:31:56Z")

</div>

i have a query on which i am bucketing year wise. Result return only 10 results

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [January 11, 2019, 11:37am UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/2 "2019-01-11T11:37:25Z")

</div>

If you're talking about the `terms` aggregation the default [size](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size) is 10.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2019, 11:54am UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/3 "2019-01-11T11:54:14Z")

</div>

Adding that if you have a date field you should use a date histogram agg probably.

---

<div class="post-metadata">

**Author:** ![examin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/examin/32/70688_2.png) [@examin](https://discuss.elastic.co/u/examin)\
**Post date:** [January 11, 2019, 12:07pm UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/4 "2019-01-11T12:07:50Z")

</div>

```
   GET /demo/_search
    {
      "size": 0,
      "query":{
        "term": {
          "STATUS": {
            "value": 3
          }
        }
      },
      "aggs": {
        "SALE": {
          "terms": {
            "field": "YEAR.keyword"
          },
          "aggs": {
            "sales": {
              "sum": {
                "field": "PRICE"
              }
            }
          }
        }
      }
    }
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 11, 2019, 2:59pm UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/5 "2019-01-11T14:59:08Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.  
Please update your post.

```auto
"terms": {
  "field": "YEAR.keyword"
}

```

So it's a Terms aggregation and as @Mark_Harwood wrote:

> [@Mark\_Harwood](#):
>
> If you're talking about the `terms` aggregation the default [size](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#search-aggregations-bucket-terms-aggregation-size) is 10.

---

<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:** [February 8, 2019, 2:59pm UTC](https://discuss.elastic.co/t/why-aggregation-result-return-max-results-only-10/163892/6 "2019-02-08T14:59:08Z")

</div>

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