简体   繁体   中英

How can i get unique count aggregation by field value with Spring Data?

I'm trying to do this:

http://prntscr.com/mb3xqx

with Spring Data Elasticsearch, but i can't find a way to make Unique Count aggregation by field value.

SearchQuery searchQuery = new NativeSearchQueryBuilder()
            .withIndices("logs-processing-*")
            .addAggregation(terms("procedure_code").field("procedure_code.keyword"))
            .build();

现在无法进行测试,但可以肯定,您应该尝试:.addAggregation(terms(“ procedure_code”)。field(“ keyword”))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM