lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: Query for a non-value
Date Wed, 22 Mar 2006 22:35:11 GMT
Nick Atkins wrote:
> Hi there,
> How do I do a query for the value of a field not being equal to
> something?  For example, we all do Query("field:value") but I want to do
> Query("NOT field:value") to essentially return all the documents that do
> not have fields with this value?  I've tried this but Lucene always
> returns no documents when I know there are plenty of documents without
> that field set to that value.

Presumably you're referring to the QueryParser not properly handling the 
case where all clauses are prohibited.

The answer to this has been on the list many times, I answered exactly 
the same question only a short while ago, it involves overriding the 


Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web:                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message