Min_score不适用于使用ElasticSearch的聚集

vnzz0bqm  于 2022-11-22  发布在  ElasticSearch
关注(0)|答案(1)|浏览(142)

是否有任何ElasticSearch成员可以帮助我准备具有min_score的聚合查询?
在下面我写了我的查询,这个弹性查询运行,但没有得到任何文档计数,但1000分数文档可用.请求:

GET product/_search
{
    "min_score":1000,
    "size":0,
    "aggs":{
        "PriceRanges":{
            "filter":{
                "bool":{
                    "should":[
                        {
                            "match_all":{
                            }
                        }
                    ],
                    "must":[
                        {
                            "term":{
                                "Published":{
                                    "value":"true"
                                }
                            }
                        },
                        {
                            "bool":{
                                "should":[
                                    {
                                        "match":{
                                            "Stores.Id":0
                                        }
                                    },
                                    {
                                        "match":{
                                            "Stores.Id":2
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            },
            "aggs":{
                "Facets":{
                    "range":{
                        "field":"UCF_FinalPrice",
                        "ranges":[
                            {
                                "to":"100"
                            },
                            {
                                "from":"101",
                                "to":"998"
                            },
                            {
                                "from":"999",
                                "to":"1999"
                            },
                            {
                                "from":"2000",
                                "to":"2999"
                            },
                            {
                                "from":"3000"
                            }
                        ]
                    }
                }
            }
        }
    }
}
this response result of this query:
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : 0.0,
    "hits" : [ ]
  },
  "aggregations" : {
    "PriceRanges" : {
      "doc_count" : 0,
      "Facets" : {
        "buckets" : [
          {
            "key" : "*-100.0",
            "to" : 100.0,
            "doc_count" : 0
          },
          {
            "key" : "101.0-998.0",
            "from" : 101.0,
            "to" : 998.0,
            "doc_count" : 0
          },
          {
            "key" : "999.0-1999.0",
            "from" : 999.0,
            "to" : 1999.0,
            "doc_count" : 0
          },
          {
            "key" : "2000.0-2999.0",
            "from" : 2000.0,
            "to" : 2999.0,
            "doc_count" : 0
          },
          {
            "key" : "3000.0-*",
            "from" : 3000.0,
            "doc_count" : 0
          }
        ]
      }
    }
  }
}

我不知道这里到底在做什么,聚合查询可能不支持min_score。或者这里有语法错误。我很感谢你的回复,这将对我很有帮助。

0lvr5msh

0lvr5msh1#

此问题似乎已在8.5.0版本中得到修复

相关问题