If this is a query you need to support often, you could create a field
"x" that contains "x" in every document. Then search on that with your
prohibited query.

If not, you could get the document list by doing your search then
removing all of those documents from a complete set outside of lucene.


On Thu, 10 Feb 2005 11:19:03 -0700, aaz <[EMAIL PROTECTED]> wrote:
> 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]
> 
>

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

Reply via email to