lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Haruska <jharu...@gmail.com>
Subject Re: != queries
Date Thu, 10 Feb 2005 18:25:23 GMT
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 <x@interoperate.com> 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" <miles@runtime-collective.com>
> 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 <miles@runtime-collective.com>
> > Runtime Collective Ltd.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message