diff --git a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java index 1133b221393..1eb1d7eb2ee 100644 --- a/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/DoublePoint.java @@ -172,7 +172,9 @@ public final class DoublePoint extends Field { * {@link #newRangeQuery(String, double[], double[])} instead. *
* You can have half-open ranges (which are in fact </≤ or >/≥ queries) - * by setting {@code lowerValue = Double.NEGATIVE_INFINITY} or {@code upperValue = Double.POSITIVE_INFINITY}. + * by setting {@code lowerValue = Double.NEGATIVE_INFINITY} or {@code upperValue = Double.POSITIVE_INFINITY}. + *
Ranges are inclusive. For exclusive ranges, pass {@code Math#nextUp(lowerValue)} + * or {@code Math.nextDown(upperValue)}. *
* Range comparisons are consistent with {@link Double#compareTo(Double)}. * @@ -190,7 +192,9 @@ public final class DoublePoint extends Field { * Create a range query for n-dimensional double values. *
* You can have half-open ranges (which are in fact </≤ or >/≥ queries) - * by setting {@code lowerValue[i] = Double.NEGATIVE_INFINITY} or {@code upperValue[i] = Double.POSITIVE_INFINITY}. + * by setting {@code lowerValue[i] = Double.NEGATIVE_INFINITY} or {@code upperValue[i] = Double.POSITIVE_INFINITY}. + *
Ranges are inclusive. For exclusive ranges, pass {@code Math#nextUp(lowerValue[i])} + * or {@code Math.nextDown(upperValue[i])}. *
* Range comparisons are consistent with {@link Double#compareTo(Double)}. * diff --git a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java index 3d110db2cd8..08192e5cac1 100644 --- a/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/FloatPoint.java @@ -172,7 +172,9 @@ public final class FloatPoint extends Field { * {@link #newRangeQuery(String, float[], float[])} instead. *
* You can have half-open ranges (which are in fact </≤ or >/≥ queries) - * by setting {@code lowerValue = Float.NEGATIVE_INFINITY} or {@code upperValue = Float.POSITIVE_INFINITY}. + * by setting {@code lowerValue = Float.NEGATIVE_INFINITY} or {@code upperValue = Float.POSITIVE_INFINITY}. + *
Ranges are inclusive. For exclusive ranges, pass {@code Math#nextUp(lowerValue)} + * or {@code Math.nextDown(upperValue)}. *
* Range comparisons are consistent with {@link Float#compareTo(Float)}. * @@ -190,7 +192,9 @@ public final class FloatPoint extends Field { * Create a range query for n-dimensional float values. *
* You can have half-open ranges (which are in fact </≤ or >/≥ queries) - * by setting {@code lowerValue[i] = Float.NEGATIVE_INFINITY} or {@code upperValue[i] = Float.POSITIVE_INFINITY}. + * by setting {@code lowerValue[i] = Float.NEGATIVE_INFINITY} or {@code upperValue[i] = Float.POSITIVE_INFINITY}. + *
Ranges are inclusive. For exclusive ranges, pass {@code Math#nextUp(lowerValue[i])} + * or {@code Math.nextDown(upperValue[i])}. *
* Range comparisons are consistent with {@link Float#compareTo(Float)}. * diff --git a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java index 53ae3d3dd2a..c40a4b73a1d 100644 --- a/lucene/core/src/java/org/apache/lucene/document/IntPoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/IntPoint.java @@ -172,9 +172,10 @@ public final class IntPoint extends Field { * {@link #newRangeQuery(String, int[], int[])} instead. *
* You can have half-open ranges (which are in fact </≤ or >/≥ queries) - * by setting {@code lowerValue = Integer.MIN_VALUE} or {@code upperValue = Integer.MAX_VALUE}. + * by setting {@code lowerValue = Integer.MIN_VALUE} or {@code upperValue = Integer.MAX_VALUE}. *
- * Ranges are inclusive. For exclusive ranges, pass {@code lowerValue + 1} or {@code upperValue - 1} + * Ranges are inclusive. For exclusive ranges, pass {@code Math.addExact(lowerValue, 1)} + * or {@code Math.addExact(upperValue, -1)}. * * @param field field name. must not be {@code null}. * @param lowerValue lower portion of the range (inclusive). @@ -192,7 +193,8 @@ public final class IntPoint extends Field { * You can have half-open ranges (which are in fact </≤ or >/≥ queries) * by setting {@code lowerValue[i] = Integer.MIN_VALUE} or {@code upperValue[i] = Integer.MAX_VALUE}. *
- * Ranges are inclusive. For exclusive ranges, pass {@code lowerValue[i] + 1} or {@code upperValue[i] - 1} + * Ranges are inclusive. For exclusive ranges, pass {@code Math.addExact(lowerValue[i], 1)} + * or {@code Math.addExact(upperValue[i], -1)}. * * @param field field name. must not be {@code null}. * @param lowerValue lower portion of the range (inclusive). must not be {@code null}. diff --git a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java index c4fd8875205..46bf93cd6ee 100644 --- a/lucene/core/src/java/org/apache/lucene/document/LongPoint.java +++ b/lucene/core/src/java/org/apache/lucene/document/LongPoint.java @@ -174,7 +174,8 @@ public final class LongPoint extends Field { * You can have half-open ranges (which are in fact </≤ or >/≥ queries) * by setting {@code lowerValue = Long.MIN_VALUE} or {@code upperValue = Long.MAX_VALUE}. *
- * Ranges are inclusive. For exclusive ranges, pass {@code lowerValue + 1} or {@code upperValue - 1} + * Ranges are inclusive. For exclusive ranges, pass {@code Math.addExact(lowerValue, 1)} + * or {@code Math.addExact(upperValue, -1)}. * * @param field field name. must not be {@code null}. * @param lowerValue lower portion of the range (inclusive). @@ -192,7 +193,8 @@ public final class LongPoint extends Field { * You can have half-open ranges (which are in fact </≤ or >/≥ queries) * by setting {@code lowerValue[i] = Long.MIN_VALUE} or {@code upperValue[i] = Long.MAX_VALUE}. *
- * Ranges are inclusive. For exclusive ranges, pass {@code lowerValue[i] + 1} or {@code upperValue[i] - 1} + * Ranges are inclusive. For exclusive ranges, pass {@code Math.addExact(lowerValue[i], 1)} + * or {@code Math.addExact(upperValue[i], -1)}. * * @param field field name. must not be {@code null}. * @param lowerValue lower portion of the range (inclusive). must not be {@code null}.