如何分页聚合导致ElasticSearch? [英] How to paging aggregation result in ElasticSearch?

查看:1066
本文介绍了如何分页聚合导致ElasticSearch?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行下面的查询时,如何分页aggs结果?

When I execute the query below, how to paging the aggs results?

有没有办法把 aggs result to hits part in json result?

And is there a method to put the aggs results to hits part in json result?

POST  http://myElastic.com/test/e1,e2,e3/_search
{
  "aggs":{
    "dedup" : {
      "terms":{
        "field": "id"
       },
       "aggs":{
         "dedup_docs":{
           "top_hits":{
             "size":1
           }
         }
       }    
    }
  }
}


推荐答案

根据Elasticsearch github网站的以下问题,我不认为您要求的是可能的:

Based on the below issue on the Elasticsearch github site I don't think what you are asking for is possible:

https://github.com/elastic/elasticsearch/issues/ 4915

似乎是一个常见的请求。添加您自己的反馈,他们可能会加入它。

Seems like a common request however. Add your own feedback and they may get around to adding it.

这篇关于如何分页聚合导致ElasticSearch?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆