[英]How can i get unique count aggregation by field value with Spring Data?
I'm trying to do this: 我正在尝试这样做:
http://prntscr.com/mb3xqx http://prntscr.com/mb3xqx
with Spring Data Elasticsearch, but i can't find a way to make Unique Count aggregation by field value. 使用Spring Data Elasticsearch,但是我找不到一种通过字段值进行唯一计数聚合的方法。
SearchQuery searchQuery = new NativeSearchQueryBuilder()
.withIndices("logs-processing-*")
.addAggregation(terms("procedure_code").field("procedure_code.keyword"))
.build();
现在无法进行测试,但可以肯定,您应该尝试:.addAggregation(terms(“ procedure_code”)。field(“ keyword”))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.