How I force Solr to return suggestions?
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.
精彩评论