Skip to content

Apache Lucene open-source search software

solr spatial: use the radius passed (including units) instead of hard-coding to miles

Yonik Seeley3e3d6d61b819
diff --git a/solr/src/java/org/apache/solr/schema/LatLonType.java b/solr/src/java/org/apache/solr/schema/LatLonType.java
index 3043c9c5300..235fdcbcbdf 100644
--- a/solr/src/java/org/apache/solr/schema/LatLonType.java
+++ b/solr/src/java/org/apache/solr/schema/LatLonType.java
@@ -107,7 +107,8 @@ public class LatLonType extends AbstractSubTypeFieldType implements SpatialQuery
Query range;
double angDistDegs = DistanceUtils.angularDistance(options.distance,
- DistanceUtils.EARTH_MEAN_RADIUS_MI) * DistanceUtils.RADIANS_TO_DEGREES;
+ options.radius) * DistanceUtils.RADIANS_TO_DEGREES;
+
//for the poles, do something slightly different
if (point[LAT] + angDistDegs > 90.0) { //we cross the north pole
//we don't need a longitude boundary at all