[ http://issues.apache.org/jira/browse/LUCENE-372?page=comments#action_12445343 ] Andreas Neumann commented on LUCENE-372: ----------------------------------------
The reason for this is that the parse() method does not ensure that the entire input string has been consumed. Query() will simply return if it encounters an unexpected token, relying on its caller to consume that token. If the query is nested, the call will throw an exception. But at the top-level, the caller is parse(), and it does not make sure that <EOF> is reached. A simple fix is to introdice a new nonterminal TopLevelQuery ::= Query <EOF>, and parse() calls TopLevelQuery. I have a patch for this, will post it together with a few new unit test cases for this. Andreas. > Unmatched right parentheses truncates query > ------------------------------------------- > > Key: LUCENE-372 > URL: http://issues.apache.org/jira/browse/LUCENE-372 > Project: Lucene - Java > Issue Type: Bug > Components: QueryParser > Affects Versions: 1.4 > Environment: Operating System: Linux > Platform: PC > Reporter: Patrick Hochstenbach > Assigned To: Lucene Developers > > The query processor truncates a query when right parentheses are unmatched. > E.g.: > secret AND illegal) AND access:confidential > will not result in a ParseException instead will run as: > secret AND illegal -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]