就像下面的http请求:基于TERM“service_project”aggr,还有2个SUM aggr“service_hour_price”和“servic_part_price”。我可以使用 Elasticsearch Nest 做同样的事情吗?
"aggs": {
"3": {
"terms": {
"field": "service_project",
"size": 50,
"order": {
"1": "desc"
}
},
"aggs": {
"1": {
"sum": {
"field": "service_hour_price"
}
},
"2": {
"sum": {
"field": "servic_part_price"
}
}
}
}
}
现在我只能使用基于 That Term Aggr 的一个 SUM Aggr,如下所示:
return s.Aggregations(a => a
.Terms("names", st => st
.Field(o => o.service_project)
.OrderDescending("sum")
.Size(term_count)
.Aggregations(aa => aa
.Sum("sum", m => m
.Field(o => o.service_hour_price)))));