handle cases when there is no value

This commit is contained in:
kimchy 2010-07-31 02:30:52 +03:00
parent 9af288a42f
commit 484665af80
1 changed files with 4 additions and 0 deletions

View File

@ -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);