I have multiple documents ingested in my ES which are of the form -
{
"weather":"cold",
"date_1":"2017/07/05",
"feedback":[
{
"date_2":"2017/08/07",
"value":28,
"comment":"not cold"
},{
"date_2":"2017/08/09",
"value":48,
"comment":"a bit chilly"
},{
"date_2":"2017/09/07",
"value":18,
"comment":"very cold"
}, ...
]
}
I want to do 2 date aggregations here, but not sure how to move ahead with it.
- I want the aggregate average of all "feedback.value" by "date_1" where "weather" is "cold"
- I want the aggregate average of all "feedback.value" by "date_2" where "weather" is "cold"
I am not sure if such aggregate query are supported by ES. I was not able to resolve it going through the documentation.
Thanks for helping with this.