lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From javier muguruza <>
Subject MatchAllDocsQuery with BooleanClause.Occur.MUST_NOT
Date Tue, 20 Dec 2005 17:42:03 GMT

If I run a query like this:
-(-body:angel) -(-body:darpa)
I get 0 hits. As I did not find any thread about that case, I though
ANDing with a MatchAllDocsQuery would return my desired set (all docs
excepting the ones with angel or darpa).

So more I do the following:
BooleanQuery mbq = new BooleanQuery();
BooleanQuery mydocs = -body:darpa query;
MatchAllDocsQuery alldocs = new MatchAllDocsQuery();
mbq.add(mydocs , BooleanClause.Occur.MUST_NOT);
mbq.add(alld, BooleanClause.Occur.MUST);

and I still get 0 hits, if I only add the alldocs query I get some
hits, does anyone see something wrong with my approach?


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

View raw message