Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.9
-
None
Description
See ConjunctionSolrSpellChecker.java
try {
if (stringDistance == null)
else if (stringDistance != checker.getStringDistance())
{ throw new IllegalArgumentException( "All checkers need to use the same StringDistance."); }} catch (UnsupportedOperationException uoe)
{ // ignore }In line stringDistance != checker.getStringDistance() there is comparing by references. So if you are using 2 or more spellcheckers with same distance algorithm, exception will be thrown anyway.
Update: As of Solr 6.5, this has been changed to stringDistance.equals(checker.getStringDistance()) .
However, LuceneLevenshteinDistance does not even override equals method.
This does not solve the problem yet, because the default equals method anyway compares references.
Hence unable to use FileBasedSolrSpellChecker .
Moreover, Some check of similar sorts should also be in the init method. So that user does not have to wait for this error during query time. If the spellcheck components have been added solrconfig.xml , it should throw error during core-reload itself.
Attachments
Attachments
Issue Links
- is a clone of
-
SOLR-6271 ConjunctionSolrSpellChecker wrong check for same string distance
- Closed