Aggregations - getting all buckets with term aggregations

How can I use aggregations to get all of the buckets in my index?
Right now I add "size:30" to get all of the buckets.

GET /index_name/_search?size=0
{
  "aggs":{
    "aggs_name":{
      "terms":{"field":"Field_Name.keyword",**"size": 30**, 
        "order": {
          "_count": "desc"
        }
      }
        }
      }
}

But I will not know how many buckets there will be, so I'd like to send a command to get all buckets by default.

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