Package org.apache.lucene.facet.range
Class Range
- java.lang.Object
-
- org.apache.lucene.facet.range.Range
-
- Direct Known Subclasses:
DoubleRange
,LongRange
public abstract class Range extends java.lang.Object
Base class for a single labeled range.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
label
Label that identifies this range.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Filter
getFilter(ValueSource valueSource)
Returns a newFilter
accepting only documents in this range.abstract Filter
getFilter(Filter fastMatchFilter, ValueSource valueSource)
Returns a newFilter
accepting only documents in this range.
-
-
-
Method Detail
-
getFilter
public abstract Filter getFilter(Filter fastMatchFilter, ValueSource valueSource)
Returns a newFilter
accepting only documents in this range. This filter is not general-purpose; you should either use it withDrillSideways
by adding it toDrillDownQuery.add(java.lang.String, java.lang.String...)
, or pass it toFilteredQuery
using itsFilteredQuery.QUERY_FIRST_FILTER_STRATEGY
. If theValueSource
is static, e.g. an indexed numeric field, then it may be more efficient to useNumericRangeFilter
. The provided fastMatchFilter, if non-null, will first be consulted, and only if that is set for each document will the range then be checked.
-
getFilter
public Filter getFilter(ValueSource valueSource)
Returns a newFilter
accepting only documents in this range. This filter is not general-purpose; you should either use it withDrillSideways
by adding it toDrillDownQuery.add(java.lang.String, java.lang.String...)
, or pass it toFilteredQuery
using itsFilteredQuery.QUERY_FIRST_FILTER_STRATEGY
. If theValueSource
is static, e.g. an indexed numeric field, then it may be more efficient to useNumericRangeFilter
.
-
-