lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Neumann (JIRA)" <>
Subject [jira] Commented: (LUCENE-372) Unmatched right parentheses truncates query
Date Sat, 28 Oct 2006 06:23:18 GMT
    [ ] 
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

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. 


> Unmatched right parentheses truncates query
> -------------------------------------------
>                 Key: LUCENE-372
>                 URL:
>             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:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message