Apologies for starting a new thread again, my mailing list subscription didn't finalize till later than Yonik's response.
Using "Field1:Val1 AND (*:* NOT Field2:Val2)" works, thanks. Does my original query "Field1:Value1 AND (NOT Field2:Val2)" fall into "need the *:* trick if all of the clauses of a boolean query are negative" case?. It does seem to have a positive and negative match attributes? can you please elaborate. Thanks for quick responses, you guys are awesome. From:Yonik Seeley (yon...@lucidimagination.com)Date:Nov 14, 2010 9:08:32 am wrote: On Sun, Nov 14, 2010 at 4:17 AM, Leonardo Menezes <leon...@googlemail.com> wrote:try Field1:Val1 AND (*:* NOT Field2:Val2), that shoud work ok That should be equivalent to Field1:Val1 -Field2:Val2 You only need the *:* trick if all of the clauses of a boolean query are negative. -Yonik http://www.lucidimagination.com To: solr-user@lucene.apache.org Subject: Solr Negative query Date: Sun, 14 Nov 2010 13:32:51 +0530 Dear Solr/Lucene gurus, I have run into a weird issue trying use a negative condition in my query. Parser:StandardQueryParserMy Query: Field1:Val1 NOT Field2:Val2Resolved as: Field1:Val1 -Field2:Val2 The above query never returns any document, no matter how we use a paranthesis. I did see some suggestions on LuceneQParser to use something like:*:* Field1:Val1 -Field2:Val2 This seems to return some documents, however it seems to ignore the first condition (Field1:Val1), Please help. ThanksVis