NumericRangeQuery is similar to NumericRangeFilter, in which you can specify lower bound and upper bound values for matching. To ensure search quality, make sure the numeric type (IntField
, FloatField
, LongField
, and DoubleField
) matches between the search and indexed field.
Here is a code snippet to demonstrate NumericRangeQuery
:
Query query = NumericRangeQuery.newIntRange("num", 0, 200, true, true);