lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: lucene query with additional clause field not null
Date Tue, 02 Dec 2014 07:30:17 GMT
Hi,

Use FieldValueFilter for that: http://lucene.apache.org/core/4_10_2/core/org/apache/lucene/search/FieldValueFilter.html
If you need a query instead of a Filter, wrap it with ConstantScoreQuery.

This is also much faster than a RangeQuery like suggested by Ahmed.

Uwe

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


> -----Original Message-----
> From: Sascha Janz [mailto:sascha.janz@gmx.net]
> Sent: Monday, December 01, 2014 8:44 PM
> To: java-user@lucene.apache.org
> Subject: lucene query with additional clause field not null
> 
> Hi,
> 
> 
> 
> is there a chance to add a additional clause to a query for a field that should
> not be null ?
> 
> 
> 
> greetings
> 
> sascha
> 
> 
> 
> 



---------------------------------------------------------------------
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