Class FieldCacheRangeFilter
A range filter built on top of a cached single term field (in IFieldCache).
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. Furthermore, it does not need the numeric values encoded by Int32Field, SingleField, Int64Field or DoubleField. But it has the problem that it only works with exact one value/document (see below).
As with all IFieldCache 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 IFieldCache, 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 IFieldCache.
Inheritance
Assembly: DistributedLucene.Net.dll
Syntax
public static class FieldCacheRangeFilter : object
Methods
Name | Description |
---|---|
NewByteRange(String, FieldCache.IByteParser, Nullable<SByte>, Nullable<SByte>, Boolean, Boolean) | Creates a numeric range filter using GetBytes(AtomicReader, String, FieldCache.IByteParser, Boolean). This works with all
|
NewByteRange(String, Nullable<SByte>, Nullable<SByte>, Boolean, Boolean) | Creates a numeric range filter using GetBytes(AtomicReader, String, Boolean). This works with all
|
NewBytesRefRange(String, BytesRef, BytesRef, Boolean, Boolean) | Creates a BytesRef range filter using GetTermsIndex(AtomicReader, String, Single). This works with all
fields containing zero or one term in the field. The range can be half-open by setting one
of the values to |
NewDoubleRange(String, FieldCache.IDoubleParser, Nullable<Double>, Nullable<Double>, Boolean, Boolean) | Creates a numeric range filter using GetDoubles(AtomicReader, String, FieldCache.IDoubleParser, Boolean). This works with all
|
NewDoubleRange(String, Nullable<Double>, Nullable<Double>, Boolean, Boolean) | Creates a numeric range filter using GetDoubles(AtomicReader, String, Boolean). This works with all
|
NewInt16Range(String, FieldCache.IInt16Parser, Nullable<Int16>, Nullable<Int16>, Boolean, Boolean) | Creates a numeric range filter using GetInt16s(AtomicReader, String, FieldCache.IInt16Parser, Boolean). This works with all
NOTE: this was newShortRange() in Lucene |
NewInt16Range(String, Nullable<Int16>, Nullable<Int16>, Boolean, Boolean) | Creates a numeric range filter using GetInt16s(AtomicReader, String, Boolean). This works with all
NOTE: this was newShortRange() in Lucene |
NewInt32Range(String, FieldCache.IInt32Parser, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean) | Creates a numeric range filter using GetInt32s(AtomicReader, String, FieldCache.IInt32Parser, Boolean). This works with all
NOTE: this was newIntRange() in Lucene |
NewInt32Range(String, Nullable<Int32>, Nullable<Int32>, Boolean, Boolean) | Creates a numeric range filter using GetInt32s(AtomicReader, String, Boolean). This works with all
NOTE: this was newIntRange() in Lucene |
NewInt64Range(String, FieldCache.IInt64Parser, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean) | Creates a numeric range filter using GetInt64s(AtomicReader, String, FieldCache.IInt64Parser, Boolean). This works with all
NOTE: this was newLongRange() in Lucene |
NewInt64Range(String, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean) | Creates a numeric range filter using GetInt64s(AtomicReader, String, Boolean). This works with all
|
NewSingleRange(String, FieldCache.ISingleParser, Nullable<Single>, Nullable<Single>, Boolean, Boolean) | Creates a numeric range filter using GetSingles(AtomicReader, String, FieldCache.ISingleParser, Boolean). This works with all
NOTE: this was newFloatRange() in Lucene |
NewSingleRange(String, Nullable<Single>, Nullable<Single>, Boolean, Boolean) | Creates a numeric range filter using GetSingles(AtomicReader, String, Boolean). This works with all
NOTE: this was newFloatRange() in Lucene |
NewStringRange(String, String, String, Boolean, Boolean) | Creates a string range filter using GetTermsIndex(AtomicReader, String, Single). This works with all
fields containing zero or one term in the field. The range can be half-open by setting one
of the values to |