You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2017/02/06 20:47:40 UTC
lucene-solr:branch_6x: LUCENE-7664: deprecate GeoPointField and its
queries
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x c9c3fb489 -> d1135b4d2
LUCENE-7664: deprecate GeoPointField and its queries
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d1135b4d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d1135b4d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d1135b4d
Branch: refs/heads/branch_6x
Commit: d1135b4d29039628cc3097e4cb1b0e09216b1814
Parents: c9c3fb4
Author: Mike McCandless <mi...@apache.org>
Authored: Mon Feb 6 15:47:24 2017 -0500
Committer: Mike McCandless <mi...@apache.org>
Committed: Mon Feb 6 15:47:24 2017 -0500
----------------------------------------------------------------------
lucene/CHANGES.txt | 4 ++++
.../apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java | 1 -
.../lucene/spatial/geopoint/document/GeoPointField.java | 7 +++++--
.../lucene/spatial/geopoint/document/GeoPointTokenStream.java | 2 ++
.../lucene/spatial/geopoint/search/GeoPointDistanceQuery.java | 5 ++++-
.../spatial/geopoint/search/GeoPointDistanceQueryImpl.java | 3 ++-
.../lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java | 3 ++-
.../spatial/geopoint/search/GeoPointInBBoxQueryImpl.java | 3 ++-
.../spatial/geopoint/search/GeoPointInPolygonQuery.java | 3 ++-
.../spatial/geopoint/search/GeoPointInPolygonQueryImpl.java | 2 ++
.../spatial/geopoint/search/GeoPointMultiTermQuery.java | 2 ++
.../spatial/geopoint/search/GeoPointNumericTermsEnum.java | 3 ++-
.../spatial/geopoint/search/GeoPointPrefixTermsEnum.java | 2 ++
.../search/GeoPointTermQueryConstantScoreWrapper.java | 2 ++
.../lucene/spatial/geopoint/search/GeoPointTermsEnum.java | 2 ++
.../apache/lucene/spatial/geopoint/search/package-info.java | 3 ++-
16 files changed, 37 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/CHANGES.txt
----------------------------------------------------------------------
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 4037f46..4dbfc8a 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -107,6 +107,10 @@ Other
* LUCENE-7658: queryparser/xml CoreParser now implements SpanQueryBuilder interface.
(Daniel Collins, Christine Poerschke)
+* LUCENE-7664: GeoPointField and its queries are deprecated in favor
+ of LatLonPoint, which offers faster indexing and searching
+ performance, smaller index, and less search-time heap usage. (Mike McCandless)
+
======================= Lucene 6.4.1 =======================
Build
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
----------------------------------------------------------------------
diff --git a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
index 5d28a7b..c6ba30f 100644
--- a/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
+++ b/lucene/analysis/smartcn/src/java/org/apache/lucene/analysis/cn/smart/hhmm/WordDictionary.java
@@ -163,7 +163,6 @@ class WordDictionary extends AbstractDictionary {
output.writeObject(charIndexTable);
output.writeObject(wordItem_charArrayTable);
output.writeObject(wordItem_frequencyTable);
- output.close();
// log.info("serialize core dict.");
} catch (Exception e) {
// log.warn(e.getMessage());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointField.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointField.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointField.java
index c20ad85..4267ee0 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointField.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointField.java
@@ -20,16 +20,16 @@ import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
+import org.apache.lucene.geo.GeoUtils;
import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.IndexOptions;
-import org.apache.lucene.geo.GeoUtils;
import org.apache.lucene.util.BitUtil;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.BytesRefBuilder;
-import static org.apache.lucene.spatial.util.MortonEncoder.encode;
import static org.apache.lucene.geo.GeoUtils.MIN_LAT_INCL;
import static org.apache.lucene.geo.GeoUtils.MIN_LON_INCL;
+import static org.apache.lucene.spatial.util.MortonEncoder.encode;
/**
* <p>
@@ -50,7 +50,10 @@ import static org.apache.lucene.geo.GeoUtils.MIN_LON_INCL;
* of terms for large queries. See LUCENE-6481 for a future improvement.
*
* @lucene.experimental
+ *
+ * @deprecated Use the higher performance {@code LatLonPoint} instead.
*/
+@Deprecated
public final class GeoPointField extends Field {
/** encoding step value for GeoPoint prefix terms */
public static final int PRECISION_STEP = 9;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointTokenStream.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointTokenStream.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointTokenStream.java
index 2808f44..02b6322 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointTokenStream.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/document/GeoPointTokenStream.java
@@ -71,7 +71,9 @@ import static org.apache.lucene.spatial.geopoint.document.GeoPointField.PRECISIO
* </pre>
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} instead.
*/
+@Deprecated
final class GeoPointTokenStream extends TokenStream {
private static final int MAX_SHIFT = PRECISION_STEP * 4;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQuery.java
index b546929..7ea6e15 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQuery.java
@@ -38,7 +38,10 @@ import org.apache.lucene.geo.GeoUtils;
* queries one can expect upwards of 400m error. Vincenty shrinks this to ~40m error but pays a penalty for computing
* using the spheroid
*
- * @lucene.experimental */
+ * @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint.newDistanceQuery} instead.
+ */
+@Deprecated
public class GeoPointDistanceQuery extends GeoPointInBBoxQuery {
/** latitude value (in degrees) for query location */
protected final double centerLat;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQueryImpl.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQueryImpl.java
index 871979c..af716f8 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQueryImpl.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointDistanceQueryImpl.java
@@ -25,7 +25,8 @@ import org.apache.lucene.util.SloppyMath;
/** Package private implementation for the public facing GeoPointDistanceQuery delegate class.
*
* @lucene.experimental
- */
+ * @deprecated Use the higher performance {@code LatLonPoint#.newDistanceQuery} instead. */
+@Deprecated
final class GeoPointDistanceQueryImpl extends GeoPointInBBoxQueryImpl {
private final GeoPointDistanceQuery distanceQuery;
private final double centerLon;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java
index 8d66e95..e9e6455 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQuery.java
@@ -41,7 +41,8 @@ import org.apache.lucene.geo.GeoUtils;
* many cells (degenerate case)
*
* @lucene.experimental
- */
+ * @deprecated Use the higher performance {@code LatLonPoint.newBoxQuery} instead. */
+ @Deprecated
public class GeoPointInBBoxQuery extends Query {
/** field name */
protected final String field;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQueryImpl.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQueryImpl.java
index 3133de6..9fe1834 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQueryImpl.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInBBoxQueryImpl.java
@@ -26,7 +26,8 @@ import org.apache.lucene.spatial.util.GeoRelationUtils;
/** Package private implementation for the public facing GeoPointInBBoxQuery delegate class.
*
* @lucene.experimental
- */
+ * @deprecated Use the higher performance {@code LatLonPoint.newBoxQuery} instead. */
+@Deprecated
class GeoPointInBBoxQueryImpl extends GeoPointMultiTermQuery {
/**
* Constructs a new GeoBBoxQuery that will match encoded GeoPoint terms that fall within or on the boundary
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQuery.java
index 7a0a9e9..cfb4efb 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQuery.java
@@ -36,7 +36,8 @@ import org.apache.lucene.geo.Polygon;
*
* @see Polygon
* @lucene.experimental
- */
+ * @deprecated Use the higher performance {@code LatLonPoint.newPolygonQuery} instead. */
+@Deprecated
public final class GeoPointInPolygonQuery extends GeoPointInBBoxQuery {
/** array of polygons being queried */
final Polygon[] polygons;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
index 006b150..761955c 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointInPolygonQueryImpl.java
@@ -26,7 +26,9 @@ import org.apache.lucene.index.PointValues.Relation;
/** Package private implementation for the public facing GeoPointInPolygonQuery delegate class.
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint.newPolygonQuery} instead.
*/
+@Deprecated
final class GeoPointInPolygonQueryImpl extends GeoPointInBBoxQueryImpl {
private final GeoPointInPolygonQuery polygonQuery;
private final Polygon2D polygons;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointMultiTermQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointMultiTermQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointMultiTermQuery.java
index 14027c1..1fb823b 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointMultiTermQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointMultiTermQuery.java
@@ -37,7 +37,9 @@ import org.apache.lucene.util.SloppyMath;
* Geospatial operations
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
+@Deprecated
abstract class GeoPointMultiTermQuery extends MultiTermQuery {
// simple bounding box optimization - no objects used to avoid dependencies
protected final double minLon;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointNumericTermsEnum.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointNumericTermsEnum.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointNumericTermsEnum.java
index 82c8a29..cee8800 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointNumericTermsEnum.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointNumericTermsEnum.java
@@ -35,7 +35,8 @@ import static org.apache.lucene.spatial.geopoint.document.GeoPointField.BITS;
* {@link GeoPointTermQueryConstantScoreWrapper} and all docs whose GeoPoint fields match the prefix terms or
* pass the {@link GeoPointMultiTermQuery.CellComparator#postFilter} criteria are returned in the resulting DocIdSet.
*
- * @lucene.experimental
+ * @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
@Deprecated
final class GeoPointNumericTermsEnum extends GeoPointTermsEnum {
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointPrefixTermsEnum.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointPrefixTermsEnum.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointPrefixTermsEnum.java
index 2979b71..d8bdb4a 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointPrefixTermsEnum.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointPrefixTermsEnum.java
@@ -36,7 +36,9 @@ import static org.apache.lucene.spatial.geopoint.document.GeoPointField.getPrefi
* resulting DocIdSet.
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
+@Deprecated
final class GeoPointPrefixTermsEnum extends GeoPointTermsEnum {
private short shift;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermQueryConstantScoreWrapper.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermQueryConstantScoreWrapper.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermQueryConstantScoreWrapper.java
index 739dec6..1350421 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermQueryConstantScoreWrapper.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermQueryConstantScoreWrapper.java
@@ -43,7 +43,9 @@ import org.apache.lucene.util.SparseFixedBitSet;
* for post filtering boundary ranges. Multi-valued GeoPoint documents are supported.
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
+@Deprecated
final class GeoPointTermQueryConstantScoreWrapper <Q extends GeoPointMultiTermQuery> extends Query {
protected final Q query;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermsEnum.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermsEnum.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermsEnum.java
index 2b5e3cc..d01cdd8 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermsEnum.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/GeoPointTermsEnum.java
@@ -28,7 +28,9 @@ import org.apache.lucene.spatial.geopoint.search.GeoPointMultiTermQuery.CellComp
* candidate GeoPointField encoded terms against terms matching the defined query criteria.
*
* @lucene.experimental
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
+@Deprecated
abstract class GeoPointTermsEnum extends FilteredTermsEnum {
protected final short maxShift;
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1135b4d/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/package-info.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/package-info.java b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/package-info.java
index 0d923df..aa81c27 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/package-info.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/geopoint/search/package-info.java
@@ -17,5 +17,6 @@
/**
* Geospatial Query Implementations for Core Lucene
+ * @deprecated Use the higher performance {@code LatLonPoint} queries instead.
*/
-package org.apache.lucene.spatial.geopoint.search;
\ No newline at end of file
+package org.apache.lucene.spatial.geopoint.search;