Package org.apache.lucene.facet.range
Class DoubleRange
- java.lang.Object
-
- org.apache.lucene.facet.range.Range
-
- org.apache.lucene.facet.range.DoubleRange
-
public final class DoubleRange extends Range
Represents a range over double values.
-
-
Field Summary
Fields Modifier and Type Field Description double
max
Maximum.boolean
maxInclusive
True if the maximum value is inclusive.double
min
Minimum.boolean
minInclusive
True if the minimum value is inclusive.
-
Constructor Summary
Constructors Constructor Description DoubleRange(java.lang.String label, double minIn, boolean minInclusive, double maxIn, boolean maxInclusive)
Create a DoubleRange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(double value)
True if this range accepts the provided value.Filter
getFilter(Filter fastMatchFilter, ValueSource valueSource)
Returns a newFilter
accepting only documents in this range.java.lang.String
toString()
-
-
-
Method Detail
-
accept
public boolean accept(double value)
True if this range accepts the provided value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFilter
public Filter getFilter(Filter fastMatchFilter, ValueSource valueSource)
Description copied from class:Range
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.
-
-