聚合结果不受大小变量的影响,最大结果为10

问题描述 投票:0回答:1

在ElasticSearch上搜索时,如果我更改了请求正文的size参数,则响应中的结果(命中数)将相应地发生变化,但聚合的结果保持不变,最大为10。

我可以通过哪种方式构造请求,以便size参数影响聚合结果?

这里是一个示例请求。响应有10个存储桶,在这种情况下,应为13

{
  "size": 10000,
  "query":{
    "bool":{
      "must":[
        {
          "match":{
            "action.keyword":"property_sync"
          }
        },
        {
          "terms":{
            "track_id.keyword": ["1687dade-5cdb-4a87-8ce5-f2f0bef19993","b10726e1-5175-4b1e-ad9e-1d007239496e","41bf3ce5-fdbc-4d00-829e-9319f7176944","870ffe02-580b-4afe-934e-e1ce0c9aac06","3a6c95c5-18c8-4e44-b9ea-7e67a622e69c","bf5cc52f-dba8-4d64-b982-91850668b91f","68245aea-5f66-4152-86a5-388e83a6b7e6","6d79e9fe-cd7b-4b3b-92ff-e38196fee4d0","cecdb344-efc6-4e89-9be3-aeff39786a25","24e9a477-4abe-4d56-b52f-31fe2d2de0bf","bdb477e2-4ebc-49b5-b211-ee5fa92d81c9","c95559d2-a306-4ef2-8f76-6b4800010a58","a859fa7c-cbe1-47c0-b116-f96b4ededac9"]
          }
        }
      ]
    }
  },
  "aggs": {
    "track_id_counter": {
      "terms": {
        "field": "track_id.keyword"
      },
      "aggs": {
        "status_counter": {
          "terms": {
            "field": "status.keyword"
          }
        }
      }
    }
  }
}

这是我的ES版本:

curl localhost:9200
{
  "name" : "1dsoqjm",
  "cluster_name" : "305323432826:ci1",
  "cluster_uuid" : "ZJep8PTKQCqaobed6_nYYQ",
  "version" : {
    "number" : "6.4.2",
    "build_flavor" : "oss",
    "build_type" : "zip",
    "build_hash" : "ccb2b31",
    "build_date" : "2019-05-22T11:04:13.556260Z",
    "build_snapshot" : false,
    "lucene_version" : "7.4.0",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}
elasticsearch elasticsearch-6
1个回答
0
投票
请仔细阅读正式文件,这个问题毫无意义,谢谢。
热门问题
推荐问题
最新问题