lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morus Walter <>
Subject Re: Misbehaving query string
Date Tue, 20 Jul 2004 06:17:45 GMT
Bill Tschumy writes:
> I would think the following strings passed to the QueryParser should 
> yield the same results:
> #1:   +telescope AND !operate
> #2:   (+telescope) AND (!operate)
> However the first string seems to give the correct results while the 
> second gives "zero" hits.  Am I misunderstanding something or is there 
> a bug?

The first query creates a boolean query with a required and a prohibited term.
The second one, creates one boolean query for the !operate term, containing
only one prohibited term and combines this with a query for telescope where
both subqueries are required (don't ask me, if telescope makes a term query
or a boolean query, I suspect the former).
But lucene doesn't search boolean queries only containing prohibited terms.
So the !operate boolean query gives you an empty result, which leads to the
empty result of the whole query.

I don't know if there's a reason, why the boolean query doesn't throw an
exception in this case. Silently not working doesn't seem a good way of 
handling this.


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

View raw message