Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6093

BlendedInfixSuggester throws NullPointerException if there were discarded trailing characters in the query

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 4.10.2
    • Fix Version/s: 4.10.4, 5.0, 5.1, 6.0
    • Component/s: modules/spellchecker
    • Labels:
      None
    • Environment:

      Any environment

    • Lucene Fields:
      New

      Description

      BlendedInfixSuggester throws NullPointerException if there were discarded trailing characters (e.g. whitespace or special character) in the query.

      The problem seems to be in the createCoefficient method that fails to check if prefixToken parameter is null. AnalyzingInfixSuggester sets prefixToken to null in the described case and passes it to BlendedInfixSuggester. On the side not even if BlendedInfixSuggester is changed to handle this creates a problem to calculate the weights as prefixToken is null and cannot be used. I would be better to have AnalyzingInfixSuggester to always set prefixToken to lastToken.

        Attachments

          Activity

            People

            • Assignee:
              janhoy Jan Høydahl
              Reporter:
              afilimonov Andrei Filimonov
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: