我拥有属性品牌和2个独特价值的产品系列:
ES查询
var response = new ElasticClient().Search<DTO>(s => s
.Index("index")
.Type("type")
.Aggregations(a => a
.Terms("unique", t => t
.Field(f => f.Brand)
//.Field(f => f.Brand.Suffix("keyword"))
.Size(1000)
)
)
);
var brands = (((BucketAggregate)response.Aggregations.First().Value).Items).Cast<KeyedBucket<Object>>().Select(x => x.Key).ToList();
ES返回4个无效值
我试图通过向字段添加.Suffix(“keyword”)强制完全属性匹配,但之后它返回空列表。如何获得2个不同的值?