hi,
how to count buckets total, when i have the following ES query
"size": 0,
"aggs": {
"buckets": {
"composite": {
"size": 20,
"sources": [
{"age": {"terms": {"field": "age"}}},
{"weight": {"terms": {"field": "weight"}}},
]
},
"aggs": {
"Max Wheight": {
"max": {
"field": "weight"
}
},
}
},
}
or such as
{
"query": {
"query_string": {
"query": "age:>=24"
}
},
"size": 0,
"aggs": {
"group_by_pni": {
"terms": {
"field": "pni"
},
"aggs": {
"group_by_code": {
"terms": {
"field": "code.keyword"
},
"aggs": {
"group_by_age": {
"terms": {
"field": "age"
},
"aggs": {
"counts age": {
"value_count": {
"field": "age"
}
},
"max_age": {
"max": {
"field": "age"
}
}
}
}
}
}
}
},
}
}
can you help me? thanks in advance