How to i force Solr to return me suggestions or close matches even on correctly spelled words?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.