【发布时间】:2023-03-06 18:11:01
【问题描述】:
使用 ES 2.3.3
我想使用Derivative Aggregation,但应该用来计算它的指标不是avg 或sum,它只是父直方图(sales_per_month)每个桶的原始doc_count .
我通过使用 stats agg 让它像这样工作:
"aggs" : {
"sales_per_month" : {
"date_histogram" : {
"field" : "date",
"interval" : "month"
},
"aggs": {
"sales": {
"stats": {
"field": "price"
}
},
"sales_deriv": {
"derivative": {
"buckets_path": "sales.count"
}
}
}
}
}
这真的是这样做的方法还是我错过了一种更简单的方法?
【问题讨论】:
标签: elasticsearch