public abstract class Range extends Object
Modifier and Type | Field and Description |
---|---|
String |
label
Label that identifies this range.
|
Modifier | Constructor and Description |
---|---|
protected |
Range(String label)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
failNoMatch()
Invoke this for a useless range.
|
abstract Filter |
getFilter(Filter fastMatchFilter,
ValueSource valueSource)
Returns a new
Filter accepting only documents
in this range. |
Filter |
getFilter(ValueSource valueSource)
Returns a new
Filter accepting only documents
in this range. |
public final String label
protected Range(String label)
public abstract Filter getFilter(Filter fastMatchFilter, ValueSource valueSource)
Filter
accepting only documents
in this range. This filter is not general-purpose;
you should either use it with DrillSideways
by
adding it to DrillDownQuery.add(java.lang.String, java.lang.String...)
, or pass it to
FilteredQuery
using its FilteredQuery.QUERY_FIRST_FILTER_STRATEGY
. If the
ValueSource
is static, e.g. an indexed numeric
field, then it may be more efficient to use NumericRangeFilter
. 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.public Filter getFilter(ValueSource valueSource)
Filter
accepting only documents
in this range. This filter is not general-purpose;
you should either use it with DrillSideways
by
adding it to DrillDownQuery.add(java.lang.String, java.lang.String...)
, or pass it to
FilteredQuery
using its FilteredQuery.QUERY_FIRST_FILTER_STRATEGY
. If the
ValueSource
is static, e.g. an indexed numeric
field, then it may be more efficient to use NumericRangeFilter
.protected void failNoMatch()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.