[
https://issues.apache.org/jira/browse/SOLR-11761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kai Chan updated SOLR-11761:
----------------------------
Attachment: SOLR-11761.patch
org.apache.solr.parser.QueryParser has two ReInit methods. I have found that if
org.apache.solr.search.SolrQueryParser calls the other ReInit method and with a
new org.apache.solr.parser.QueryParserTokenManager object, then the parser
properly re-initializes itself. Patch with my fix and Steve Rowe's test
attached.
> Query parsing with comments fail in org.apache.solr.parser.QueryParser
> ----------------------------------------------------------------------
>
> Key: SOLR-11761
> URL: https://issues.apache.org/jira/browse/SOLR-11761
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Affects Versions: 6.2.1, master (8.0), 6.6.2
> Environment: Java 1.8
> Reproduced issue on org.apache.solr:solr-core:6.2.1 and 6.6.2
> Reporter: Andreas Presthammer
> Attachments: SOLR-11761.patch
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]