我正在尝试将第一个元素的属性“open”和最后一个元素的属性“close”添加到内部聚合中。任何人都知道如何做到这一点?
该文件如下:
{
"id": "1b73c03c-182e-4092-bf23-7fb6e2525586",
"assetId": 5,
"open": 143.345,
"close": 143.355,
"min": 143.335,
"max": 143.355,
"tS": "2017-04-10T18:24:00"
}
代码是:
.Aggregations(a => a
.DateHistogram("bars", st => st
.Field(o => o.TS)
.Interval(interval)
.MinimumDocumentCount(2)
.Aggregations(childAggs => childAggs
.Min("min", avg => avg.Field(p => p.Min))
.Max("max", avg => avg.Field(p => p.Max))
)
)
)
提前致谢