lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uwe Schindler" <>
Subject RE: FieldCacheRangeFilter Vs NumericRangeQuery
Date Wed, 08 Dec 2010 20:52:26 GMT
Hi Romi,

Depending on how many documents are returned, FieldCacheRangeFilter (may)
outperform NumericRangeQuery/Filter. But for sparse results,
NumericRangeQuery performs much better. Look here:

Additionally take into account that the FieldCache must be built before the
first query (warming) and FC only works correct with exactly one value /
document. Missing values or more than one value break FieldCache usage for
range filtering. FieldCacheRangeFilter is good, if you use it on fields you
are already need for sorting and are in FieldCache already.

Please note: Bothe NumericRangeFilter and FieldCacheRangeFilter can be used
with CachingWrapperFilter. In this case, NumericRangeFilter is faster most
times (when already cached).


Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen

> -----Original Message-----
> From: Romi []
> Sent: Wednesday, December 08, 2010 7:45 AM
> To:
> Subject: FieldCacheRangeFilter Vs NumericRangeQuery
> Hi,
>    I am using Lucene3.0 for my project. I used FieldCacheRangeFilter
> method newLongRange()) with NumericRangeQuery in one implementation
> of dateRangeQuery search and only NumericRangeQuery for another
> implementation of dateRangeQuery search.
> I found 17525 documents via both implementation but search time via
> FieldCacheRangeFilter was 172milliseconds while via NumericRangeQuery
> search it was 62milliseconds.
> I got confused because i was expecting that FieldCacheRangeFilter do
> faster.
> Why it happened please explain.
> -----
> Romi
> --
> View this message in context:
> NumericRangeQuery-tp2038419p2038419.html
> Sent from the Lucene - General mailing list archive at

View raw message