diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/geo/GeoDistanceFilter.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/geo/GeoDistanceFilter.java index 9c57e938a03..4c4cf918b89 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/geo/GeoDistanceFilter.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/lucene/geo/GeoDistanceFilter.java @@ -96,6 +96,10 @@ public class GeoDistanceFilter extends Filter { } @Override public boolean get(int doc) throws IOException { + if (!latFieldData.hasValue(doc) || !lonFieldData.hasValue(doc)) { + return false; + } + if (latFieldData.multiValued()) { double[] lats = latFieldData.doubleValues(doc); double[] lons = latFieldData.doubleValues(doc);