【问题标题】:What's the difference between query_string and multi_match?query_string 和 multi_match 有什么区别?
【发布时间】:2016-10-07 23:31:16
【问题描述】:

运行此查询时:

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

-

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

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

【问题讨论】:

    标签: elasticsearch lucene


    【解决方案1】:

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

    因此查询字符串的功能要强大得多,但它也可能导致意外情况,例如/ 可能导致部分字符串被解释为正则表达式。

    DrTech 在 in this answer 上展示了这两个方面做得非常出色。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-05-18
      • 2011-01-11
      • 1970-01-01
      • 1970-01-01
      • 2010-10-02
      • 2011-12-12
      • 2010-09-16
      • 2012-03-14
      相关资源
      最近更新 更多