【问题标题】:Configuration of the all field elastic search全域弹性搜索的配置
【发布时间】:2018-07-23 21:41:16
【问题描述】:

我的 ES _all 字段有问题,例如这个文档:

field_1: "ar"
field_2: "gus"

当我用 _all 查询“ar gus”时,这匹配,我明白为什么

_all = "ar gus"

但是有什么方法可以使这个查询不匹配,比如在字符串中添加一些偏移量或分隔符?

_all = "ar (space)(space) or some other gus"

我搜索了很多,但我没有找到任何东西。

谢谢

【问题讨论】:

    标签: elasticsearch search


    【解决方案1】:

    如果您希望文档匹配“ar gus”而不匹配“ar gus”,则需要使用match_phrase query(也请检查here)并在搜索查询中配置slop 属性。

    可以肯定的是,如果 _all 字段对您造成困扰,您可以禁用它(here,在 ES 6.X 中默认禁用)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-03
      • 2023-01-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多