Solr
  1. Solr
  2. SOLR-5090

NPE in DirectSpellChecker with alternativeTermCount and mm.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.4
    • Fix Version/s: 4.8.1, 4.9, 6.0
    • Component/s: spellchecker
    • Labels:
      None
    • Environment:

      4.4.0 1504776 - sarowe - 2013-07-19 02:58:35

      Description

      Query with three terms of which one is misspelled and spellcheck.alternativeTermCount=0&mm=3 yields the following NPE:

      ERROR org.apache.solr.servlet.SolrDispatchFilter  – null:java.lang.NullPointerException
              at org.apache.lucene.search.spell.DirectSpellChecker.suggestSimilar(DirectSpellChecker.java:422)
              at org.apache.lucene.search.spell.DirectSpellChecker.suggestSimilar(DirectSpellChecker.java:355)
              at org.apache.solr.spelling.DirectSolrSpellChecker.getSuggestions(DirectSolrSpellChecker.java:189)
              at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:188)
              at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208)
              at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)
              at org.apache.solr.core.SolrCore.execute(SolrCore.java:1904)
              at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:659)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:362)
              at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:158
      
      1. SOLR-5090.patch
        6 kB
        James Dyer
      2. SOLR-5090.patch
        3 kB
        James Dyer

        Activity

        Hide
        Markus Jelsma added a comment -

        NPE does not always show up if there is at least one misspelling. The following yields and error:
        q=zinkoide vaseline creme&spellcheck.alternativeTermCount=0&mm=3 (zinkoxide is misspelled as zinkoide)

        but this one doesn't:
        q=zinkoide vaseline crème&spellcheck.alternativeTermCount=0&mm=3 (note the accent)

        Accents are folded in our the analyzers but not in the spellchecked field.

        Show
        Markus Jelsma added a comment - NPE does not always show up if there is at least one misspelling. The following yields and error: q=zinkoide vaseline creme&spellcheck.alternativeTermCount=0&mm=3 (zinkoxide is misspelled as zinkoide) but this one doesn't: q=zinkoide vaseline crème&spellcheck.alternativeTermCount=0&mm=3 (note the accent) Accents are folded in our the analyzers but not in the spellchecked field.
        Hide
        Jack Krupansky added a comment -

        This NPE has a similar signature to an NPE that I filed back in January - SOLR-4320.

        I filed several NPE's against spellcheck back then, also: SOLR-4366, SOLR-4304, SOLR-4399.

        Show
        Jack Krupansky added a comment - This NPE has a similar signature to an NPE that I filed back in January - SOLR-4320 . I filed several NPE's against spellcheck back then, also: SOLR-4366 , SOLR-4304 , SOLR-4399 .
        Hide
        Uwe Schindler added a comment -

        Move issue to Solr 4.9.

        Show
        Uwe Schindler added a comment - Move issue to Solr 4.9.
        Hide
        James Dyer added a comment -

        Here is a fix with a unit test scenario. This ignores "spellcheck.alternativeTermCount" when set to zero as its absurd to ask spellcheckers to return zero suggestions for a word. (both DirectSpellChecker and the legacy IndexBasedSpellChecker choke on this scenario)

        I plan to commit this in a few days.

        Show
        James Dyer added a comment - Here is a fix with a unit test scenario. This ignores "spellcheck.alternativeTermCount" when set to zero as its absurd to ask spellcheckers to return zero suggestions for a word. (both DirectSpellChecker and the legacy IndexBasedSpellChecker choke on this scenario) I plan to commit this in a few days.
        Hide
        James Dyer added a comment -

        better patch w/consistent change to int from Integer on the "alternativeTermCount" parameter.

        Show
        James Dyer added a comment - better patch w/consistent change to int from Integer on the "alternativeTermCount" parameter.
        Hide
        ASF subversion and git services added a comment -

        Commit 1592591 from jdyer@apache.org in branch 'dev/trunk'
        [ https://svn.apache.org/r1592591 ]

        SOLR-5090: SpellCheckComponent sometimes throws NPE when "spellcheck.alternativeTermCount" is set to zero

        Show
        ASF subversion and git services added a comment - Commit 1592591 from jdyer@apache.org in branch 'dev/trunk' [ https://svn.apache.org/r1592591 ] SOLR-5090 : SpellCheckComponent sometimes throws NPE when "spellcheck.alternativeTermCount" is set to zero
        Hide
        ASF subversion and git services added a comment -

        Commit 1592595 from jdyer@apache.org in branch 'dev/branches/branch_4x'
        [ https://svn.apache.org/r1592595 ]

        SOLR-5090: SpellCheckComponent sometimes throws NPE when "spellcheck.alternativeTermCount" is set to zero

        Show
        ASF subversion and git services added a comment - Commit 1592595 from jdyer@apache.org in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1592595 ] SOLR-5090 : SpellCheckComponent sometimes throws NPE when "spellcheck.alternativeTermCount" is set to zero
        Hide
        ASF subversion and git services added a comment -

        Commit 1592821 from hossman@apache.org in branch 'dev/branches/lucene_solr_4_8'
        [ https://svn.apache.org/r1592821 ]

        Merge back several "low hanging" bug fixes into the 4.8 branch...
        SOLR-6029: r1590867
        SOLR-6030: r1591555
        SOLR-6037: r1591800
        SOLR-6023: r1592195
        SOLR-5090: r1592591
        SOLR-6039: r1592605
        SOLR-5993: r1588415
        SOLR-5904: r1587702

        Show
        ASF subversion and git services added a comment - Commit 1592821 from hossman@apache.org in branch 'dev/branches/lucene_solr_4_8' [ https://svn.apache.org/r1592821 ] Merge back several "low hanging" bug fixes into the 4.8 branch... SOLR-6029 : r1590867 SOLR-6030 : r1591555 SOLR-6037 : r1591800 SOLR-6023 : r1592195 SOLR-5090 : r1592591 SOLR-6039 : r1592605 SOLR-5993 : r1588415 SOLR-5904 : r1587702

          People

          • Assignee:
            James Dyer
            Reporter:
            Markus Jelsma
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development