怎么又是你

elasticsearch怎么把两个字段放在一个桶里聚合去重?太难了...

Elasticsearch | 作者 zit | 发布于2019年09月19日 | 阅读数:2594

搜了n多关键词,看了n遍文档,实在是找不到方法啊,有大佬知道吗
已邀请:

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自: zit

考虑下对数据的预处理,
比如1:借助:copy_to 字段:https://www.elastic.co/guide/e ... .html
比如2:借助:ingest 字段整合
 
去重的话借助:
1、cardinality
2、top_hits聚合
3、collapse折叠
 
https://blog.csdn.net/laoyang3 ... 05676

dadaball

赞同来自:

您可以在kibana index pattern 裡面新增一個script field 把兩個字段合併起來 doc['str1'].value + doc['str2'].value,再聚合就可以了。
 

要回复问题请先登录注册