I am using a sum aggregation to find the minimum of all the sums.
GET /prod*/_search
{
"size": 0,
"aggs": {
"buckets": {
"terms": {
"field": "city.keyword",
"size": 10
},
"aggs": {
"city_views": {
"sum": {
"field": "View"
}
}
}
},
"min_city_view": {
"min_bucket": {
"buckets_path": "buckets>city_views"
}
}
}
}
I only want it to return the minimum value, not the sum aggregations(so that I can reduce the data transfer from server), how is it possible?