lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Eck" <tim...@gmail.com>
Subject RE: query for documents WITHOUT a field?
Date Thu, 16 Feb 2012 21:13:43 GMT
Thanks for the fast response. I'll certainly have a look at the upcoming
3.6.x release. What is the expected performance for using a negated filter?
In particular does it defeat the index in any way and require a full index
scan? Is it different between regular fields and numeric fields?

For 3.5 and earlier though, is there any suggestion other than magic values?

-----Original Message-----
From: Uwe Schindler [mailto:uwe@thetaphi.de] 
Sent: Thursday, February 16, 2012 1:07 PM
To: java-user@lucene.apache.org
Subject: RE: query for documents WITHOUT a field?

Lucene 3.6 will have a FieldValueFilter that can be negated:

Query q = new ConstantScoreQuery(new FieldValueFilter("field", true));

(see http://goo.gl/wyjxn)

Lucen 3.5 does not yet have it, you can download 3.6 snapshots from Jenkins:
http://goo.gl/Ka0gr

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de


> -----Original Message-----
> From: Tim Eck [mailto:teck@terracottatech.com]
> Sent: Thursday, February 16, 2012 9:59 PM
> To: java-user@lucene.apache.org
> Subject: query for documents WITHOUT a field?
> 
> My apologies if this answer is readily available someplace, I've searched
> around and not found a definitive answer.
> 
> 
> 
> I'd like to run a query for documents that _do not_ contain particular
indexed
> fields to implement something like a SQL-like query where a column is
null.
> 
> 
> 
> I understand I could possibly use a magic value to represent "null", but
the data
> I'm searching doesn't led itself to reserving a value for null. I also
understand I
> could add an extra field to hold this boolean isNull state but would love
a better
> solution :-)
> 
> 
> 
> TIA
> 
> 



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



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


Mime
View raw message