Ok, that makes sense. Any suggestions on how to AND that prohibited clause with a query to get everything?

----- Original Message ----- From: "Miles Barr" <[EMAIL PROTECTED]>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Thursday, February 10, 2005 11:07 AM
Subject: Re: != queries



On Thu, 2005-02-10 at 11:02 -0700, aaz wrote:
I have an index with field "documentNumber". There are 10 documents. One of the documents has documentNumber A5058970

I want to return all matches where documentNumber != A505*. I should get 9 docs back.

I construct a query like

wq = WildcardQuery("documentNumber","a505*")

BooleanQuery bq = new BooleanQuery();
bq.addQuery(wq,false,true);

I always get no results for this type of query.

Ideas?

A restriction can only filter out search results and not add to them. So the search is starting with an empty set, then trying to filter out the results with a document number starting A505, i.e. doing nothing.




-- Miles Barr <[EMAIL PROTECTED]> Runtime Collective Ltd.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to