距离为 3 的 Solr 中的模糊搜索

Fuzzy Search in Solr with distance 3

我在 Solr 中使用模糊搜索,如下所示 -

预期的词 - 海豚

Level 1 Search - dolpin~1 -> gives dolphin
Level 2 Search - dlphn~2 -> gives dolphin
Level 3 search - dlpn~3 -> does not give dolphin, gives some weird results like glen, den etc.

如何在 3 级搜索中获得海豚?

模糊搜索无法做到这一点,因为 edit distance is limited to a maximum of two edits:

An optional distance parameter specifies the maximum number of edits allowed, between 0 and 2, defaulting to 2.

在你的情况下,使用(非常)概括的方法可能会得到更好的结果 phonetic algorithm

如果您查看模糊搜索代表的内容(编辑距离),您可以看到 dlpn 如何匹配 glen:

dlpn -> (d|g)l(p|e)n -> glen
          ^     ^     
          2 edits

当您进行模糊搜索并使用短期术语时,与您查询的内容相比,返回的元素会有更多差异。