lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luke Francl <>
Subject What is the difference between these searches?
Date Tue, 09 Nov 2004 19:58:45 GMT

I've implemented a converter to translate our system's internal Query
objects to Lucene's Query model.

I recently realized that my implementation of "OR NOT" was not working
as I would expect and I was wondering if anyone on this list could give
me some advice.

I am converting a query that means "foo or not bar" into the following:

+item_type:xyz +(field_name:foo -field_name:bar)

This returns only Documents where field_name contains foo. I would
expect it to return all the Documents where field_name contains foo or
field_name doesn't contain bar.

Fiddling around with the Lucene Index Toolbox, I think that this query
does what I want:

+item_type:xyz field_name:foo -field_name:bar

Can someone explain to me why these queries return different results?

Luke Francl

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

View raw message