I am trying to apply range on the result that I got from sum aggregation.
Below query helps me to find sum of amount of individual phone
{
"size": 0,
"aggs": {
"group_by_phone": {
"terms": {
"field": "phone.keyword"
},
"aggs": {
"total_call_amount": {
"sum": {
"field": "amount"
}
}
}
}
}
}
Now I want to filter by applying range on total_call_amount which is summing above 8000.