【发布时间】:2015-12-15 19:03:08
【问题描述】:
我正在使用 Nest 对 ElasticSearchIndex 执行“_all”查询。我指定了三种类型:
s.Types(typeof(TypeA), typeof(TypeB), typeof(TypeC));
s.Query(q => q.QueryString(qs => qs
.DefaultField("_all")
.Query(criteria.SearchText)));
我正在尝试使用聚合来获取每种类型的总数。我试过像这样使用 Nest 代码:
s.Aggregations(a => a.Sum("typeA", b => b.Field("Type")));
但它没有奏效。有谁知道如何使用 Nest 来实现这一点?
【问题讨论】:
标签: c# elasticsearch aggregate nest