Skip to content

Commit

Permalink
Early termination with PointValues
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Dec 6, 2024
1 parent 3eecea4 commit a28c8cc
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,12 @@ public Relation isFieldWithinQuery(
if (isSearchable() == false && hasDocValues()) {
return Relation.INTERSECTS;
}

if (PointValues.size(reader, name()) == 0) {
// no points, so nothing matches
return Relation.DISJOINT;
}

if (dateParser == null) {
dateParser = this.dateMathParser;
}
Expand All @@ -638,11 +644,6 @@ public Relation isFieldWithinQuery(
}
}

if (PointValues.size(reader, name()) == 0) {
// no points, so nothing matches
return Relation.DISJOINT;
}

long minValue = LongPoint.decodeDimension(PointValues.getMinPackedValue(reader, name()), 0);
long maxValue = LongPoint.decodeDimension(PointValues.getMaxPackedValue(reader, name()), 0);

Expand Down

0 comments on commit a28c8cc

Please sign in to comment.