query_string和multi_match有什么区别? [英] What's the difference between query_string and multi_match?

查看:432
本文介绍了query_string和multi_match有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行此查询时:

{
  "query_string" : {
    "query" : "text",
    "fields": ["field1", "field2"]
  }
}

-

{
  "multi_match" : {
    "query" : "text",
    "fields": ["field1", "field2"]
  }
}

有什么区别?何时使用一个,何时使用另一个?

What is the difference? When to use one and when to use the other?

推荐答案

query_string 支持Lucene语法来解释文本,其中为 multi_match 只是尝试将给定的文本 与列出的字段的索引值进行匹配

query_string supports Lucene syntax to interpret the text, where as multi_match just attempts to match the given "text" against the listed fields' indexed values.

查询字符串因此功能更强大,但也会导致意外情况,例如 / 可能导致部分

Query string is therefore far more powerful, but it can also lead to unexpected scenarios, such as where / may cause part of the string to be interpreted as a regular expression.

DrTech表现出色,在在此答案中

DrTech does a pretty excellent job demonstrating the two over in this answer.

这篇关于query_string和multi_match有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆