include all data in aggregation elasticsearch code example
Example: terms aggregation elasticsearch using Key order
GET /_search
{
"aggs": {
"genres": {
"terms": {
"field": "genre",
"order": { "_count": "asc" }
}
}
}
}