Why aggregation result return max results only 10

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

If you're talking about the terms aggregation the default size is 10.

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

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

Please format your code, logs or configuration files using </> icon as explained in this guide 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:

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.

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

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

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