You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Sascha Janz <sa...@gmx.net> on 2014/12/01 20:44:28 UTC

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

 

 


RE: lucene query with additional clause field not null

Posted by Uwe Schindler <uw...@thetaphi.de>.
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


Re: lucene query with additional clause field not null

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Sascha,

Generally RangeQuery is used for that, e.g. fieldName:[* TO *]

Ahmet


On Monday, December 1, 2014 9:44 PM, Sascha Janz <sa...@gmx.net> wrote:
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