简体   繁体   English

聚合分页在Elasticsearch中使用'from'和'size'

[英]Aggregation paging use 'from' and 'size' in Elasticsearch

I want paging results using from and size attributes. 我想要使​​用from和size属性的分页结果。

but, 'from' attribute in aggregation is not supported expression. 但是,不支持聚合中的'from'属性。

Can I get other approach? 我可以采取其他方法吗?

Query Syntax: 查询语法:

{
  "size": 0,
    "query": {
        "bool": {
            "must": [{
                "match_phrase": {
                    "name": "John"
                }
            }]
        }
    },
  "aggs":{
    "dedup" : {
      "terms":{
        "field": "job",
        "from": 2, <<-- Is it possible??
        "size": 1
       },
       "aggs":{
         "dedup_docs":{
           "top_hits":{
             "size":1
           }
         }
       }
    }
  }
}

This is error message: 这是错误消息:

"type": "search_parse_exception" “ type”:“ search_parse_exception”

"reason": "Unknown key for a VALUE_NUMBER in [dedup]: [from].", “ reason”:“ [dedup]:[from]中VALUE_NUMBER的未知键。”,

Aggregation can not use 'page' attribution. 汇总不能使用“页面”归因。 please check 'scroll' api. 请检查“滚动” API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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