ES对字段去重统计,抛出异常:java.lang.IllegalArgumentException: Two sibling aggregations cannot have the same name:
时间:2020-06-18 18:54:21
收藏:0
阅读:567
出错场景:多次调用ES统计方法,第二次时会报错。
解决办法:在AggregationBuilders.cardinality("tempField").field("countFiled"),中的"tempField"用一个随机字符串代替。
查询后取结果的时候,再用随机字符串取出。
原文:https://www.cnblogs.com/seufelix/p/13159156.html
评论(0)