lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Re: Enumerating NumericField using TermEnum?
Date Sun, 13 Sep 2009 18:09:59 GMT

>> NumericField uses a spezial encoding of terms for fast NumericRangeQueries.
>> It indexes more than one term per value. How many terms depends on the
>> precisionStep ctor parameter. If you set it to infinity (or something ge the
>> bit size of your value, 32 for ints, it indexes exactly one value). These
>> terms are used for very fast numeric queries. This extra overhead only has a
>> positive impact for field with high cardinality (something > 500). For a
>> simple hour field with 24 distinct values, the speed impact of
>> NumericRangeQuery would be neglectible, it may even be a little bit slower
>> because of additional overhead. I would suggest to use NumericField ony for
>> real high-cardinality fields (like unix time stamps, prices,
>> latitudes/longitudes (all types of float/doubles), day of year,...).
>> Maybe I add this t the javadocs.
+1 - intuition might be to use it for anything numeric.

- Mark

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message