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

TextField.analyzeMultiTerm should not throw exception when analyzer returns no term

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.1, 4.10.2, 6.0
    • Fix Version/s: None
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      In TextField.analyzeMultiTerm()
      at line
      try {
      if (!source.incrementToken())
      throw new SolrException();

      The method should not throw an exception if there is no token because having no token is legitimate because all tokens may be filtered out (e.g. with a blocking Filter such as StopFilter).

      In this case it should simply return null (as it already returns null in some cases, see first line of method). However, SolrQueryParserBase needs also to be fixed to correctly handle null returned by TextField.analyzeMultiTerm().

      See attached TestTextField for the corresponding new test class.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              broustant Bruno Roustant
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: