java.lang.Object | |||
↳ | org.apache.lucene.search.Filter | ||
↳ | org.apache.lucene.search.MultiTermQueryWrapperFilter<Q extends org.apache.lucene.search.MultiTermQuery> | ||
↳ | org.apache.lucene.search.NumericRangeFilter<T extends java.lang.Number> |
A Filter
that only accepts numeric values within
a specified range. To use this, you must first index the
numeric values using NumericField
(expert: NumericTokenStream
).
You create a new NumericRangeFilter with the static factory methods, eg:
Filter f = NumericRangeFilter.newFloatRange("weight", 0.3f, 0.10f, true, true);accepts all documents whose float valued "weight" field ranges from 0.3 to 0.10, inclusive. See
NumericRangeQuery
for details on how Lucene
indexes and searches numeric valued fields.
NOTE: This API is experimental and might change in incompatible ways in the next release.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.MultiTermQueryWrapperFilter
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the field name for this filter
| |||||||||||
Returns the upper value of this range filter
| |||||||||||
Returns the lower value of this range filter
| |||||||||||
Returns
true if the upper endpoint is inclusive | |||||||||||
Returns
true if the lower endpoint is inclusive | |||||||||||
Factory that creates a
NumericRangeFilter , that filters a double
range using the given precisionStep . | |||||||||||
Factory that creates a
NumericRangeFilter , that queries a double
range using the default precisionStep PRECISION_STEP_DEFAULT (4). | |||||||||||
Factory that creates a
NumericRangeFilter , that filters a float
range using the given precisionStep . | |||||||||||
Factory that creates a
NumericRangeFilter , that queries a float
range using the default precisionStep PRECISION_STEP_DEFAULT (4). | |||||||||||
Factory that creates a
NumericRangeFilter , that queries a int
range using the default precisionStep PRECISION_STEP_DEFAULT (4). | |||||||||||
Factory that creates a
NumericRangeFilter , that queries a long
range using the default precisionStep PRECISION_STEP_DEFAULT (4). | |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.search.MultiTermQueryWrapperFilter
| |||||||||||
From class
org.apache.lucene.search.Filter
| |||||||||||
From class
java.lang.Object
|
Returns the upper value of this range filter
Returns the lower value of this range filter
Returns true
if the upper endpoint is inclusive
Returns true
if the lower endpoint is inclusive
Factory that creates a NumericRangeFilter
, that filters a double
range using the given precisionStep
.
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that queries a double
range using the default precisionStep
PRECISION_STEP_DEFAULT
(4).
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that filters a float
range using the given precisionStep
.
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that queries a float
range using the default precisionStep
PRECISION_STEP_DEFAULT
(4).
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that filters a int
range using the given precisionStep
.
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that queries a int
range using the default precisionStep
PRECISION_STEP_DEFAULT
(4).
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that queries a long
range using the default precisionStep
PRECISION_STEP_DEFAULT
(4).
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.
Factory that creates a NumericRangeFilter
, that filters a long
range using the given precisionStep
.
You can have half-open ranges (which are in fact </≤ or >/≥ queries)
by setting the min or max value to null
. By setting inclusive to false, it will
match all documents excluding the bounds, with inclusive on, the boundaries are hits, too.