javascript,elasticsearch,average,datahistory
Just realized that I could do a nested aggregation and then calculate the average of a field inside a aggregation. Here is what I did and it's working properly now: query = { "query": { "bool": { "must": [ { "term": {"deviceId":device} }, { "match": {"eventType":"Connected"} } ], "must_not":[{ "query_string":...