问题描述
Apaches Solr搜索引擎是否提供近似的字符串匹配,例如通过Levenshtein算法?
我正在寻找一种通过姓氏查找客户的方法.但是我不能保证名称的正确性.我该如何配置Solr以便找到该人即使我搜索"Levenstein",还是"Levenshtein"?
通常使用 SpellCheckComponent ,默认情况下内部使用 Lucene SpellChecker 来实现Levenshtein. >
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近似字符串匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!