在 Elasticsearch 索引中,我有商标数据。我在数据库中有一个名为HILTON
的商标,但是当我搜索hillytown
时没有找到hilton
,但是当搜索hilytown
时找到了。我搜索hilton
时如何修改elsatic搜索以找到hillytown
注意::hillytown
有两个l
我尝试的搜索是
$param = '
{
"query": {
"fuzzy" : {
"trademark" : {
"value": "'.$keyword.'",
"boost": 1.0,
"fuzziness": "AUTO",
"prefix_length": 0,
"max_expansions": 100,
"transpositions":true
}
}
}
}';
在
http://localhost:9200/watch_index_write/_search
最佳答案
我认为您无法使“hillytown”与“hilton”相匹配。 Elasticsearch allows的最大模糊度(levenshtein distance)为2,但是hillytown的距离为3(需要删除3个字母)。
我自己还没有尝试过,但是phonetic analysis plugin可能提供了前进的道路。
关于elasticsearch - Elasticsearch 模糊搜索未找到所需结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51400645/