You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by nk...@apache.org on 2016/02/07 05:27:28 UTC

[5/5] lucene-solr git commit: add super.rewrite to GeoPointInPolygonQuery.rewrite, fix invalid javadoc reference

add super.rewrite to GeoPointInPolygonQuery.rewrite, fix invalid javadoc reference


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/cc052491
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/cc052491
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/cc052491

Branch: refs/heads/branch_5x
Commit: cc052491cad5063b87fc61189c48b1d7b6656ce3
Parents: 331c03d
Author: nknize <nk...@apache.org>
Authored: Sat Feb 6 22:13:00 2016 -0600
Committer: nknize <nk...@apache.org>
Committed: Sat Feb 6 22:26:38 2016 -0600

----------------------------------------------------------------------
 .../apache/lucene/spatial/document/GeoPointTokenStream.java    | 4 ++--
 .../apache/lucene/spatial/search/GeoPointInPolygonQuery.java   | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cc052491/lucene/spatial/src/java/org/apache/lucene/spatial/document/GeoPointTokenStream.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/document/GeoPointTokenStream.java b/lucene/spatial/src/java/org/apache/lucene/spatial/document/GeoPointTokenStream.java
index ff97fee..1d19167 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/document/GeoPointTokenStream.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/document/GeoPointTokenStream.java
@@ -40,7 +40,7 @@ import static org.apache.lucene.spatial.document.GeoPointField.PRECISION_STEP;
  * <p><i>NOTE: This is used as the default encoding unless
  * {@code GeoPointField.setNumericType(FieldType.LegacyNumericType.LONG)} is set</i></p>
  *
- * This class is similar to {@link org.apache.lucene.analysis.LegacyNumericTokenStream} but encodes terms up to a
+ * This class is similar to {@link org.apache.lucene.analysis.NumericTokenStream} but encodes terms up to a
  * a maximum of {@link #MAX_SHIFT} using a fixed precision step defined by
  * {@link GeoPointField#PRECISION_STEP}. This yields a total of 4 terms per GeoPoint
  * each consisting of 5 bytes (4 prefix bytes + 1 precision byte).
@@ -49,7 +49,7 @@ import static org.apache.lucene.spatial.document.GeoPointField.PRECISION_STEP;
  * {@link GeoPointField#PREFIX_TYPE_STORED}</p>
  *
  * <p>If prefix terms are used then the default GeoPoint query constructors may be used, but if
- * {@link org.apache.lucene.analysis.LegacyNumericTokenStream} is used, then be sure to pass
+ * {@link org.apache.lucene.analysis.NumericTokenStream} is used, then be sure to pass
  * {@link GeoPointField.TermEncoding#NUMERIC} to all GeoPointQuery constructors</p>
  *
  * Here's an example usage:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cc052491/lucene/spatial/src/java/org/apache/lucene/spatial/search/GeoPointInPolygonQuery.java
----------------------------------------------------------------------
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/search/GeoPointInPolygonQuery.java b/lucene/spatial/src/java/org/apache/lucene/spatial/search/GeoPointInPolygonQuery.java
index eb8c50c..960cc66 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/search/GeoPointInPolygonQuery.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/search/GeoPointInPolygonQuery.java
@@ -16,6 +16,7 @@
  */
 package org.apache.lucene.spatial.search;
 
+import java.io.IOException;
 import java.util.Arrays;
 
 import org.apache.lucene.index.IndexReader;
@@ -84,7 +85,10 @@ public final class GeoPointInPolygonQuery extends GeoPointInBBoxQuery {
 
   /** throw exception if trying to change rewrite method */
   @Override
-  public Query rewrite(IndexReader reader) {
+  public Query rewrite(IndexReader reader) throws IOException {
+    if (getBoost() != 1f) {
+      return super.rewrite(reader);
+    }
     return new GeoPointInPolygonQueryImpl(field, termEncoding, this, this.minLon, this.minLat, this.maxLon, this.maxLat);
   }