newRangeQuery

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

Create a range query for network addresses.

You can have half-open ranges (which are in fact / queries) by setting lowerValue = InetAddressPoint.MIN_VALUE or upperValue = InetAddressPoint.MAX_VALUE.

Ranges are inclusive. For exclusive ranges, pass InetAddressPoint#nextUp(lowerValue) or InetAddressPoint#nexDown(upperValue).

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, lowerValue is null, or upperValue is null