如何配置 Solr 以使用 Levenshtein 近似字符串匹配? [英] How to configure Solr to use Levenshtein approximate string matching?

查看:18
本文介绍了如何配置 Solr 以使用 Levenshtein 近似字符串匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apaches Solr 搜索引擎是否提供近似字符串匹配,例如通过 Levenshtein 算法?

我正在寻找一种按姓氏查找客户的方法.但我不能保证名称的正确性.如何配置 Solr 以便它可以找到该人Levenshtein",即使我搜索Levenstein"?

解决方案

通常使用 SpellCheckComponent,内部默认使用 Lucene SpellChecker,它实现了 Levenshtein.p>

wiki 很好地解释了它是如何工作的,如何配置它以及有哪些选项可用,这里不再赘述.

或者您可以只使用 Lucene 的模糊搜索运算符.

另一种选择是使用 语音过滤器 而不是 Levenshtein.

Does Apaches Solr search engine provide approximate string matches, e.g. via Levenshtein algorithm?

I'm looking for a way to find customers by last name. But I cannot guarantee the correctness of the names. How can I configure Solr so that it would find the person "Levenshtein" even if I search for "Levenstein" ?

解决方案

Typically this is done with the SpellCheckComponent, which internally uses the Lucene SpellChecker by default, which implements Levenshtein.

The wiki really explains very well how it works, how to configure it and what options are available, no point repeating it here.

Or you could just use Lucene's fuzzy search operator.

Another option is using a phonetic filter instead of Levenshtein.

这篇关于如何配置 Solr 以使用 Levenshtein 近似字符串匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆