diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 6bf393ebe25..34eeab33390 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -147,9 +147,12 @@ New Features filtering. Range trees can also handle values larger than 64 bits. (Adrien Grand, Mike McCandless) -* LUCENE-6647: Add GeoHash string utility APIs (Nick Knize, Mike +* LUCENE-6647: Add GeoHash string utility APIs (Nick Knize via Mike McCandless). +* LUCENE-6710: GeoPointField now uses full 64 bits (up from 62) to encode + lat/lon (Nick Knize via Mike McCandless). + API Changes * LUCENE-6508: Simplify Lock api, there is now just diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointTermsEnum.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointTermsEnum.java index c47f03f092b..37d30ec78f9 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointTermsEnum.java +++ b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointTermsEnum.java @@ -17,6 +17,7 @@ package org.apache.lucene.search; * limitations under the License. */ +import java.math.BigInteger; import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -67,7 +68,13 @@ class GeoPointTermsEnum extends FilteredTermsEnum { */ private final void computeRange(long term, final short shift) { final long split = term | (0x1L<>>1); + final short level = (short)((GeoUtils.BITS<<1)-res>>>1); // if cell is within and a factor of the precision step, or it crosses the edge of the shape add the range final boolean within = res % GeoPointField.PRECISION_STEP == 0 && cellWithin(minLon, minLat, maxLon, maxLat); diff --git a/lucene/sandbox/src/java/org/apache/lucene/util/GeoUtils.java b/lucene/sandbox/src/java/org/apache/lucene/util/GeoUtils.java index 05f861dbd86..48cd1ad5eb4 100644 --- a/lucene/sandbox/src/java/org/apache/lucene/util/GeoUtils.java +++ b/lucene/sandbox/src/java/org/apache/lucene/util/GeoUtils.java @@ -27,9 +27,9 @@ import java.util.ArrayList; public final class GeoUtils { private static final short MIN_LON = -180; private static final short MIN_LAT = -90; - public static final short BITS = 31; - private static final double LON_SCALE = (0x1L<