newRangeQuery

fun newRangeQuery(field: String, lowerValue: Float, upperValue: Float): Query

Create a range query for float values.

This is for simple one-dimension ranges, for multidimensional ranges use .newRangeQuery instead.

You can have half-open ranges (which are in fact / queries) by setting lowerValue = Float.NEGATIVE_INFINITY or upperValue = Float.POSITIVE_INFINITY.

Ranges are inclusive. For exclusive ranges, pass .nextUp or .nextUp.

Range comparisons are consistent with Float.compareTo.

Return

a query matching documents within this range.

Parameters

field

field name. must not be null.

lowerValue

lower portion of the range (inclusive).

upperValue

upper portion of the range (inclusive).

Throws

if field is null.


fun newRangeQuery(field: String, lowerValue: FloatArray, upperValue: FloatArray): Query

Create a range query for n-dimensional float values.

You can have half-open ranges (which are in fact / queries) by setting lowerValue[i] = Float.NEGATIVE_INFINITY or upperValue[i] = Float.POSITIVE_INFINITY.

Ranges are inclusive. For exclusive ranges, pass Math#nextUp(lowerValue[i]) or Math.nextDown(upperValue[i]).

Range comparisons are consistent with Float.compareTo.

Return

a query matching documents within this range.

Parameters

field

field name. must not be null.

lowerValue

lower portion of the range (inclusive). must not be null.

upperValue

upper portion of the range (inclusive). must not be null.

Throws

if field is null, if lowerValue is null, if upperValue is null, or if lowerValue.length != upperValue.length