Skip to content

Commit 7ef5fa5

Browse files
authored
remove usage of Lucene's GeoRelationUtils (#52165)
Lucene removed GeoRelationUtils, and so this commit inlines ES's usage of this utiity class.
1 parent a9d6a58 commit 7ef5fa5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/main/java/org/elasticsearch/index/fielddata/MultiGeoValues.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import org.apache.lucene.document.ShapeField;
2222
import org.apache.lucene.index.IndexableField;
23-
import org.apache.lucene.spatial.util.GeoRelationUtils;
2423
import org.apache.lucene.store.ByteBuffersDataOutput;
2524
import org.apache.lucene.util.BytesRef;
2625
import org.elasticsearch.common.geo.CentroidCalculator;
@@ -111,8 +110,8 @@ public BoundingBox boundingBox() {
111110

112111
@Override
113112
public GeoRelation relate(Rectangle rectangle) {
114-
if (GeoRelationUtils.pointInRectPrecise(geoPoint.lat(), geoPoint.lon(),
115-
rectangle.getMinLat(), rectangle.getMaxLat(), rectangle.getMinLon(), rectangle.getMaxLon())) {
113+
if (geoPoint.lat() >= rectangle.getMinLat() && geoPoint.lat() <= rectangle.getMaxLat()
114+
&& geoPoint.lon() >= rectangle.getMinLon() && geoPoint.lon() <= rectangle.getMaxLon()) {
116115
return GeoRelation.QUERY_CROSSES;
117116
}
118117
return GeoRelation.QUERY_DISJOINT;

0 commit comments

Comments
 (0)