【发布时间】:2017-03-28 17:09:30
【问题描述】:
我是弹性搜索的新手。我使用嵌套来查询来自 elasticsearch 的数据。
聚合后多字段的结果表达式我想要什么方式。
示例:
class public InfoComputer
{
int Id {get;set;}
string Name {get;set;}
int price {get;set;}
int quantity {get;set;}
};
var result = client.Search<InfoComputer>(s => s
.Aggregations(a => a
.Terms("names", st => st
.Field(o => o.Name)
.Aggregations(aa => aa
.Sum("price", m => m
.Field(o => o.price)
)
)
)
)
);
此代码仅获取 Sum 属性价格。
如何获得Sum (price * quantity) 与组属性名称?
【问题讨论】:
标签: asp.net elasticsearch nest