A Range is an immutable object. @author Jean-Paul Vetterli
Note: This class is new and its interface subject to change.
This example creates a range of Integers whose minimum value is 1 and the maximum value is 5. The range is inclusive at both ends:
Range intRange = new Range(Integer.class, new Integer(1), new Integer(5));
A Range can be unbounded at either or both of its ends. An unbounded end is specified by passing null for the value of that end. A Range unbounded at both of its ends represents a range of all possible values for the Class of elements in that Range. The isMinIncluded() method will always return true for a Range unbounded on the minimum side and correspondingly the isMaxIncluded() method will always return true for a Range unbounded on the maximum side.
An empty range is defined as a Range whose minimum value is greater than it's maximum value if the ends are included, or as a Range whose minimum value is greater than or equal to it's maximum value, if the minimum or the maximum value is excluded.
@since JAI 1.1
Matches documents with fields that have terms within a certain range. The type of the Sensei query depends on the field type, for string fields, the TermRangeQuery, while for number/date fields, the query is a NumericRangeQuery. The following example returns all documents where age is between 10 and 20:
The range query top level parameters include:
| Name | Description |
|---|---|
from | The lower bound. Defaults to start from the first. |
to | The upper bound. Defaults to unbounded. |
include_lower | Should the first from (if set) be inclusive or not. Defaults to true |
include_upper | Should the last to (if set) be inclusive or not. Defaults to true. |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |