Class FieldCacheRangeFilter
A range filter built on top of a cached single term field (in FieldCache).
FieldCacheRangeFilter builds a single cache for the field the first time it is used. Each subsequent FieldCacheRangeFilter on the same field then reuses this cache, even if the range itself changes.
This means that FieldCacheRangeFilter is much faster (sometimes more than 100x as fast) as building a TermRangeFilter if using a NewStringRange(String, String, String, Boolean, Boolean). However, if the range never changes it is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single TermRangeFilter.
For numeric data types, this filter may be significantly faster than NumericRangeFilter<T>. Furthermore, it does not need the numeric values encoded by NumericField. But it has the problem that it only works with exact one value/document (see below).
As with all FieldCache based functionality, FieldCacheRangeFilter is only valid for fields which exact one term for each document (except for NewStringRange(String, String, String, Boolean, Boolean) where 0 terms are also allowed). Due to a restriction of FieldCache, for numeric ranges all terms that do not have a numeric value, 0 is assumed.
Thus it works on dates, prices and other single value fields but will not work on
regular text fields. It is preferable to use a NOT_ANALYZED
field to ensure that
there is only a single term.
This class does not have an constructor, use one of the static factory methods available, that create a correct instance for different data types supported by FieldCache.
Inheritance
Namespace:
Assembly: Lucene.Net.NetCore.dll
Syntax
public static class FieldCacheRangeFilter : object
Methods
Name | Description |
---|---|
NewByteRange(String, ByteParser, Nullable<SByte>, Nullable<SByte>, Boolean, Boolean) | Creates a numeric range filter using |
NewByteRange(String, Nullable<SByte>, Nullable<SByte>, Boolean, Boolean) | Creates a numeric range filter using |
NewDoubleRange(String, DoubleParser, Nullable<Double>, Nullable<Double>, Boolean, Boolean) | Creates a numeric range query using |
NewDoubleRange(String, Nullable<Double>, Nullable<Double>, Boolean, Boolean) | Creates a numeric range query using |
NewFloatRange(String, FloatParser, Nullable<Single>, Nullable<Single>, Boolean, Boolean) | Creates a numeric range query using |
NewFloatRange(String, Nullable<Single>, Nullable<Single>, Boolean, Boolean) | Creates a numeric range query using |
NewIntRange(String, IntParser, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean) | Creates a numeric range query using |
NewIntRange(String, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean) | Creates a numeric range query using |
NewLongRange(String, LongParser, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean) | Creates a numeric range query using |
NewLongRange(String, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean) | Creates a numeric range query using |
NewShortRange(String, ShortParser, Nullable<Int16>, Nullable<Int16>, Boolean, Boolean) | Creates a numeric range query using |
NewShortRange(String, Nullable<Int16>, Nullable<Int16>, Boolean, Boolean) | Creates a numeric range query using |
NewStringRange(String, String, String, Boolean, Boolean) | Creates a string range filter using |