使用模糊性是否会在 simple_query_string 中禁用前缀搜索

Does using fuzziness disable prefix search in a simple_query_string

当使用 simple_query_string 和前缀运算符 * 模糊值 ~N 在同一个词上时,前缀搜索似乎被禁用。

{
  "query": {
    "simple_query_string": {
      "query": "Abcd*~2",
      "fields": ["name"]
    }
  }
}

很明显,只要您将模糊度设置为 0 并且查询变为 Abcd*~0,那么就没有前缀搜索,也没有模糊度。

文档中没有提到这一点,所以我不确定我是否做错了。

我试过:


1 我假设在这种情况下 ~2 不应被解释为 SLOP 运算符,因为没有短语(没有引号)。

2 我可以理解,合成这些效果可能会产生太多可能的变体——模糊添加 50 个变体,然后对每个变体进行前缀搜索,

根据查询字符串 docs

Mixing fuzzy and wildcard operators is not supported. When mixed, one of the operators is not applied. For example, you can search for app~1 (fuzzy) or app* (wildcard), but searches for app*~1 do not apply the fuzzy operator (~1).

它会考虑通配符或模糊,以先到者为准。 对于 Abcd~2* 只是返回所有文件