开发者

How I force Solr to return suggestions?

开发者 https://www.devze.com 2023-01-17 16:46 出处:网络
How to i force Solr to return me suggestions or close matches even on cor开发者_如何转开发rectly spelled words?Unfortunately, I don\'t think it is possible. The Lucene SpellChecker class (which is use

How to i force Solr to return me suggestions or close matches even on cor开发者_如何转开发rectly spelled words?


Unfortunately, I don't think it is possible. The Lucene SpellChecker class (which is used by Solr), won't return suggestions if the word has a high frequency in your index. If you activate spellcheck.onlyMorePopular, Lucene will return suggestions that have a frequency >= than the frequency of the original word. So if a word is correctly spelled but is rare, you should receive suggestions. But for common words, you won't get anything.

UPDATE
I just stumble upon the FileBasedSpellChecker which does not use the frequency of the words of the query. I have never tried it. To use it, you will have to maintain a list of words in a flat file to build the dictionary.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号