【发布时间】:2019-04-08 14:55:30
【问题描述】:
我正在尝试为我在 Elasticsearch 中做的项目测试几个测试用例。模糊查询给出的结果对于特定情况令人困惑:- 在搜索 Mall 关键字时,模糊度 2 应用于多重匹配查询,它也匹配 Mile。
As per fuzziness documentation :-
=> 0 edits are allowed for string length is 0-2 .
=> 1 edit is allowed for string length is 3-5.
=> 2 edits are allowed for string length greater than 5.
如果是这种情况,为什么 MILE 与 MALL 匹配,因为按照逻辑只允许进行一次编辑,如果我们看到 MALL->MILE,我们需要2 次编辑。 Elasticsearch 的行为是否符合预期,或者我在这里遗漏了什么。 我正在对字段使用简单的空格分析器并使用
进行查询 { "query": {
"multi_match": {
"query": "mall",
"fields": [
"name"
],
"fuzziness": 2
} }}
【问题讨论】:
标签: elasticsearch elastic-stack fuzzy-search damerau-levenshtein