Issue Details (XML | Word | Printable)

Key: LUCENE-72
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Lucene Developers
Reporter: Carlos
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

[PATCH] Query parser inconsistency when using terms to exclude.

Created: 31/Dec/02 10:48 PM   Updated: 31/Dec/07 01:52 PM
Return to search
Component/s: QueryParser
Affects Version/s: 1.2
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File patch6.txt 2004-02-09 08:10 PM Jean-François Halleux 0.8 kB
Text File patch7.txt 2004-02-09 08:14 PM Jean-François Halleux 0.7 kB
Java Source File Licensed for inclusion in ASF works TestRegressionLucene72.java 2006-08-29 05:08 PM Dejan Nenov 8 kB
Java Source File Licensed for inclusion in ASF works TestRegressionLucene72.java 2006-08-29 05:58 AM Dejan Nenov 7 kB
Environment:
Operating System: All
Platform: PC
Issue Links:
Reference
 

Bugzilla Id: 15739


 Description  « Hide
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



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jeff Turner made changes - 03/Sep/05 03:23 PM
Field Original Value New Value
issue.field.bugzillaimportkey 15739 12314222
Dejan Nenov made changes - 29/Aug/06 05:58 AM
Attachment TestRegressionLucene72.java [ 12339743 ]
Dejan Nenov made changes - 29/Aug/06 05:08 PM
Attachment TestRegressionLucene72.java [ 12339786 ]
Hoss Man made changes - 30/Aug/06 05:55 PM
Link This issue is related to LUCENE-666 [ LUCENE-666 ]
Michael Busch made changes - 31/Dec/07 01:52 PM
Priority Major [ 3 ] Minor [ 4 ]