Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,11 @@ protected void verifyRandomDistances(float[] xs, float[] ys) throws Exception {
final float centerX = nextX();
final float centerY = nextY();

// So the query can cover at most 50% of the cartesian space:
final float radius = random().nextFloat() * Float.MAX_VALUE / 2;
float radius = 0f;
while (radius == 0f) {
// So the query can cover at most 50% of the cartesian space:
radius = random().nextFloat() * Float.MAX_VALUE / 2;
}

if (VERBOSE) {
final DecimalFormat df =
Expand Down Expand Up @@ -953,6 +956,7 @@ protected void verifyRandomDistances(float[] xs, float[] ys) throws Exception {
}

if (hits.get(docID) != expected) {
final float finalRadius = radius;
Consumer<StringBuilder> explain =
(b) -> {
if (Double.isNaN(xs[id]) == false) {
Expand All @@ -964,7 +968,7 @@ protected void verifyRandomDistances(float[] xs, float[] ys) throws Exception {
.append(" distance=")
.append(distance)
.append(" vs radius=")
.append(radius);
.append(finalRadius);
}
};
buildError(docID, expected, id, xs, ys, query, liveDocs, explain);
Expand Down
Loading