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

Query parsing with comments fail in org.apache.solr.parser.QueryParser

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.2.1, 6.6.2, 8.0
    • Fix Version/s: None
    • Component/s: query parsers
    • Labels:
      None
    • Environment:

      Java 1.8
      Reproduced issue on org.apache.solr:solr-core:6.2.1 and 6.6.2

      Description

      Repro:

      org.apache.solr.parser.QueryParser queryParser = ...
      queryParser.parse("/* foo */ bar"); // works fine
      queryParser.parse("/*"); // fails with SyntaxError, which is correct.
      queryParser.parse("/* foo */ bar"); // Fails with SyntaxError. This is the bug
      queryParser.parse("bar"); // works fine
      queryParser.parse("/* foo */ bar"); // Still failing with SyntaxError

      The last parse call will continue to fail for expressions containing comments. Only way to work around that I've found it to create a new instance of QueryParser.

        Attachments

        1. SOLR-11761.patch
          2 kB
          Kai Chan

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andreas.presthammer Andreas Presthammer
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: