Re: MatchAllDocsQuery with BooleanClause.Occur.MUST_NOT

2005-12-20 Thread javier muguruza
The double negatives are a byproduct of my code building the query, as the user has several fields to choose from etc, it is not done on purpose. With luke I was able to see that: +body:memo 1 hit +body:memo -body:policy 0 +body:memo -(-body:policy) 1 +body:memo +(-body:policy) 0 In the last two c

Re: MatchAllDocsQuery with BooleanClause.Occur.MUST_NOT

2005-12-20 Thread Yonik Seeley
I'm not sure I understand the purpose of the double negatives. Also, a boolean query must have some non-prohibited clauses to match anything (and mydocs in your code example violates this). Is the following what you are trying to do? BooleanQuery mbq = new BooleanQuery(); TermQuery mydocs = body:

MatchAllDocsQuery with BooleanClause.Occur.MUST_NOT

2005-12-20 Thread javier muguruza
Hi, 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 Bool