且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用n-grams近似匹配与Solr?

更新时间:2022-11-29 10:34:02

回答你问题的最后一部分:solr 还有一个 ngram 过滤器.所以你不应该使用 ngram 分词器(例如像WhitespaceTokenizer"这样的分词器),应用所有 pre-ngram 过滤器,然后添加这个:

To answer to the last part of your question: solr has also an ngram filter. So you should not use the ngram tokenizer (but one like "WhitespaceTokenizer" for example), apply all pre-ngram filters and then add this one:

<filter class="solr.NGramFilterFactory" minGramSize="2" maxGramSize="3" />