lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miles Barr <mi...@runtime-collective.com>
Subject Re: != queries
Date Thu, 10 Feb 2005 18:07:45 GMT
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


Mime
View raw message