【问题标题】:Fuzzy Search in Solr with distance 3Solr中距离为3的模糊搜索
【发布时间】:2019-09-17 15:02:52
【问题描述】:

我在 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.

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

【问题讨论】:

    标签: solr


    【解决方案1】:

    你不能用模糊搜索来做到这一点,就像edit distance is limited to a maximum of two edits

    可选的距离参数指定允许的最大编辑次数,介于 0 和 2 之间,默认为 2。

    在您的情况下,使用(非常)泛化phonetic algorithm 可能会获得更好的结果。

    如果你看一下模糊搜索代表什么(编辑距离),你可以看到dlpn如何匹配glen

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

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

    【讨论】:

      猜你喜欢
      • 2022-11-13
      • 2013-05-15
      • 2013-02-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-21
      • 2012-06-08
      • 1970-01-01
      相关资源
      最近更新 更多