lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dejan Nenov (JIRA)" <>
Subject [jira] Updated: (LUCENE-72) [PATCH] Query parser inconsistency when using terms to exclude.
Date Tue, 29 Aug 2006 17:10:23 GMT
     [ ]

Dejan Nenov updated LUCENE-72:


Please ignore the previos version - it was very sloppy. 
I added one more test, which yields a strange (for me) result:

fruits OR -tomatoes

returns only:

fruits vegetables peppers kiwis
fruits vegetables peppers bananas

but does not return:

fruits vegetables tomatoes bananas
fruits vegetables tomatoes kiwis

I would expected all four docs to match?

> [PATCH] Query parser inconsistency when using terms to exclude.
> ---------------------------------------------------------------
>                 Key: LUCENE-72
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: QueryParser
>    Affects Versions: 1.2
>         Environment: Operating System: All
> Platform: PC
>            Reporter: Carlos
>         Assigned To: Lucene Developers
>         Attachments: patch6.txt, patch7.txt,,
> Hi.
> The problem I am having occurs when using queryparser and also when building the
> query using the API.
> Assume that we want to look for documents about fruits or vegetables but 
> excluding tomatoes and bananas. I suppose the right query sould be:
> +(fruits vegetables) AND (-tomatoes -bananas)
> wich I think is equivalent to (if tou parse it and then print the query.toString
> ("") result that is what you get)
> +(fruits vegetables) +(-tomatoes -bananas)
> but the query doesn't work as expected, in fact the query that works is
> +(fruits vegetables) -(-tomatoes -bananas)
> which doesn´t really make much sense, because the second part seems to say:
> All documents where the condition "tomatoes is not present and bananas is not 
> present " is false, which means the opposite.
> In fact, second query works as (even if they look quite opposite):
> +(fruits vegetables) -tomatoes -bananas
> Hope someone could help, thanks

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