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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 6.2.1, 6.6.2, 8.0
    • None
    • query parsers
    • None
    • 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

            Unassigned Unassigned
            andreas.presthammer Andreas Presthammer
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: