Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-10513

CLONE - ConjunctionSolrSpellChecker wrong check for same string distance

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.9
    • Fix Version/s: 7.4
    • Component/s: spellchecker
    • Labels:


      See ConjunctionSolrSpellChecker.java

      try {
      if (stringDistance == null)

      { stringDistance = checker.getStringDistance(); }

      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.


        1. SOLR-10513.patch
          5 kB
          James Dyer
        2. SOLR-10513.patch
          12 kB
          Amrit Sarkar
        3. SOLR-10513.patch
          12 kB
          Amrit Sarkar
        4. SOLR-10513.patch
          10 kB
          Amrit Sarkar
        5. SOLR-10513.patch
          4 kB
          Amrit Sarkar
        6. SOLR-10513.patch
          3 kB
          Amrit Sarkar
        7. SOLR-10513.patch
          2 kB
          Amrit Sarkar

        Issue Links



            • Assignee:
              jdyer James Dyer
              asingh2411 Abhishek Kumar Singh


              • Created:

                Issue deployment