Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.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_Elasticsearch 7 - Fatal编程技术网 elasticsearch 搜索具有多个匹配项的所有数据,elasticsearch,elasticsearch-7,elasticsearch,Elasticsearch 7" /> elasticsearch 搜索具有多个匹配项的所有数据,elasticsearch,elasticsearch-7,elasticsearch,Elasticsearch 7" />

elasticsearch 搜索具有多个匹配项的所有数据

elasticsearch 搜索具有多个匹配项的所有数据,elasticsearch,elasticsearch-7,elasticsearch,Elasticsearch 7,我正在Elasticsearch中使用multi\u match搜索。如何使用multi_match返回所有数据 我想这样做: curl-XGET'http://localhost:9200/routines/_search?pretty=true&q=*:*“但使用搜索特定短语时使用的多重匹配结构 我的查询如下所示: { query: { bool: { should: [

我正在Elasticsearch中使用
multi\u match
搜索。如何使用
multi_match
返回所有数据

我想这样做:
curl-XGET'http://localhost:9200/routines/_search?pretty=true&q=*:*“
但使用搜索特定短语时使用的
多重匹配结构

我的查询如下所示:

{
            query: {
                bool: {
                    should: [
                        {
                            nested: {
                                path: "steps",
                                query: {
                                    nested: {
                                        path: "steps.products",
                                        query: {
                                            multi_match: {
                                                query: *,
                                                fields: [
                                                    "steps.products.name"
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        {
                            multi_match: {
                                query: *,
                                fields: [
                                    "title"
                                ]
                            }
                        }
                    ]
                }
            }
        }

我希望我可以使用
*
匹配所有结果,但它不起作用。如何保留此查询并仅更改
query
的值集?

多匹配查询允许我们在多个字段上运行查询。它是匹配查询的扩展。

当您使用多匹配查询搜索未指定字段的特定短语时,默认情况下会提取中提到的所有字段


我已经更新了这个问题。你能看一下吗?很遗憾,你当前的答案对我没有帮助。@NorahJones,我没有得到答案。我可以知道为什么要使用
*
来匹配特定字段的所有结果吗?
{
  "query": {
    "multi_match" : {
      "query":    "your-phrase"
    }
  }
}