I am using Elasticsearch to keep track of some data. The data has the following columns:
- datetime
- attribute
- value (float)
I need to calculate daily min, max, avg values for each attribute over a longer period of time (say, a year). Currently, I am using aggregations on a per-day basis and making a lot of calls. How do I use some variant of date histograms or another solution to achieve this in a single call? I was going to construct very long aggregation queries (where the first level of the aggregation hierarchy is my attribute and the second level is date), but the query will be an MxN level nesting (M attributes, N days in the range). I am sure there's a better way. Would appreciate any guidance.
PS: Have looked at things like the following, but I can't figure out how to get that to work for my specific need