lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Satuluri, Venu_Madhav" <Venu.Madhav.Satul...@deshaw.com>
Subject ORing complementary queries gives no results
Date Tue, 23 May 2006 09:17:32 GMT
Hi all,

I build Query objects programmatically. I do this by getting a
TermQuery/PhraseQuery/whatever for each term in the user query, make a
BooleanClause by specifying isRequired and isProhibited depending on
whether the term has an "and" or an "or" or an "or not" etc prefixed
before it (I use 1.4.3, which is why I use isRequired, isProhibited
instead of BooleanClause.OCCUR). I combine all the BooleanClauses in the
end to get my final Query.

This is working fine, except for one case where I ORed two complementary
queries, i.e. I searched for "name:xyz or -name:xyz". Both of these
queries independently produce results but both joined together don't.
The isRequired parameter is false for both the parts of the query, while
isProhibited is true for the second and false for the first. Shouldn't
this query return all the documents which have some value of the field
"name"?

Thanks,
Venu

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message