The requested URL was not found on this server. 不管你信不信,反正我是没找到

es子聚合如何返回一条源数据

Elasticsearch | 作者 redhat | 发布于2019年01月09日 | 阅读数:1838

需求:根据ip进行terms聚合,希望同时返回每个ip的一条源数据,请问通过什么子聚合能达到,目前是通过top_hits子聚合能达到效果,请问还有其他方法吗?
已邀请:

rochy - rochy_he

赞同来自: redhat

top_hits 是最佳选择
还有一种方式可以不使用聚合:使用 collapse 配合 inner_hits 也能达到你想要的效果
参考:https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册