I have documents of shape
{ amount, status, timestamp ...other }
and I was wondering if I can group them by day, status and have count and sum(amount)?
Basically, the response be:
"buckets" : [
{
"key" : "COMPLETED",
"doc_count" : 19395,
"amount" : 452455
},
{
"key" : "CANCELLED",
"doc_count" : 126,
"amount" : 95322
},
...
]
Currently, I'm stuck trying to add "amount" there.