Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 最小值应与嵌套对象匹配_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Nested - Fatal编程技术网 elasticsearch 最小值应与嵌套对象匹配,elasticsearch,nested,elasticsearch,Nested" /> elasticsearch 最小值应与嵌套对象匹配,elasticsearch,nested,elasticsearch,Nested" />

elasticsearch 最小值应与嵌套对象匹配

elasticsearch 最小值应与嵌套对象匹配,elasticsearch,nested,elasticsearch,Nested,我有一些关于最小匹配条件查询的问题 在我的文档中,我有以下人员嵌套对象的映射 "people": { "type": "nested", "properties": { "name": { "type": "string", "index": "not_analyzed" } } } 我正在尝试使用最小匹配嵌套查询。此代码位于嵌套范围内: "bool": { "should": [ {

我有一些关于最小匹配条件查询的问题

在我的文档中,我有以下人员嵌套对象的映射

"people": {
   "type": "nested",
   "properties": {
      "name": {
         "type": "string",
         "index": "not_analyzed"
       }
     }
}
我正在尝试使用最小匹配嵌套查询。此代码位于嵌套范围内:

"bool": {
    "should": [
     {
       "terms": {
          "people.name": [
                 "Anna",
                 "Mark",
                 "Joe"
                 ],
           "minimum_should_match": "100%",
            "boost": 3
           }
        }
    ]
}
即使包含这三个名称的文档在我的索引中,我也没有结果

问题是否与人员数据的嵌套结构有关? 我想有更高的文件名称匹配高分

我尝试了
“执行”:“或”
,结果

QueryParsingException[[my_db] [terms] query does not support [execution]
我发现的唯一解决方案是在should范围内用不同的term语句分隔每个名称

这会影响查询的复杂性吗?有时我必须找到30个名称的文档。

试试这个:

"query": {
    "bool": {
        "should": [
            {"nested":
                {"path": "people",
                    "query": {
                        "terms" : {
                            "people.name" :["Anna", "Joe"]
                        }                           
                    }
                }
            }
        ]
      }
    }