lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <...@thetaphi.de>
Subject RE: Performance of NULL check *:* -category:[* TO *]
Date Mon, 13 May 2013 18:13:18 GMT
There is a Filter that can find documents *without* or *with any* value: FieldValueFilter

http://lucene.apache.org/core/4_3_0/core/org/apache/lucene/search/FieldValueFilter.html

You can create a query out of it: new ConstantScoreQuery(new FieldValueFilter("fieldname",
true))

Uwe

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


> -----Original Message-----
> From: srividhyau [mailto:srividhya.umashanker@hp.com]
> Sent: Monday, May 13, 2013 8:05 PM
> To: java-user@lucene.apache.org
> Subject: Performance of NULL check *:* -category:[* TO *]
> 
> All -
> 
> We have a necessity to check for attributes with null values.
> There are 2 options that we narrowed down to
> 
> 1. Either we index null values with 'NULL' string and then check against the
> string.
>    This has a drawback as Lucene does not have the capability of setting any
> default value. and each document may have a different set of fields to index.
> 
> 2. The other approach is to check the negative query as follows, which does
> fetch me all the documents that has category with null
>     *:* -_category:[* TO *]
> 
> 
> Question:
> 1. Is there any impact in the query peformance (execution time) if you do the
> above query because we fetch all documents and then negate. Has anybody
> tried checking the Query performance 2. Assume we are talking of 10 million
> documents in the index.
> 
> -Vidhya
> 
> 
> 
> 
> 
> 
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Performance-of-NULL-check-category-
> TO-tp4063021.html
> Sent from the Lucene - Java Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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