Extend aggregation calculation to previous time range


I want to do a Derivative aggregation, but because derivative is using 2 data point for calculation, the first bucket doesn't have a value.

Is there any way to tell ES to query for the previous bucket as well so the first bucket will have a value, but not return the previous bucket in the response?

Not sure if this is applicable to your use case, but the way I approached this was to drop the first bucket when it came to doing anything with the aggregated data. So increase your initial search parameters beyond that which you are actually interested in, and then trim down the responses to the buckets you are actually interested in as you parse the result set.

Yeah I was hoping for something internal to Elasticsearch...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.