Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-5771: Remove BBoxStrategy's support for Overlaps because it never actually did work.

David Wayne Smiley7df563e4098a
diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java b/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
index f5fa9e512c5..16cd656d40c 100644
--- a/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
+++ b/lucene/spatial/src/java/org/apache/lucene/spatial/bbox/BBoxStrategy.java
@@ -53,7 +53,7 @@ import org.apache.lucene.spatial.query.UnsupportedSpatialOperation;
* <ul>
* <li>Only indexes Rectangles; just one per field value.</li>
* <li>Can query only by a Rectangle.</li>
- * <li>Supports all {@link SpatialOperation}s.</li>
+ * <li>Supports most {@link SpatialOperation}s -- not Overlaps.</li>
* <li>Uses the DocValues API for any sorting / relevancy.</li>
* </ul>
*
@@ -186,8 +186,7 @@ public class BBoxStrategy extends SpatialStrategy {
else if( op == SpatialOperation.IsEqualTo ) spatial = makeEquals(bbox);
else if( op == SpatialOperation.IsDisjointTo ) spatial = makeDisjoint(bbox);
else if( op == SpatialOperation.IsWithin ) spatial = makeWithin(bbox);
- else if( op == SpatialOperation.Overlaps ) spatial = makeIntersects(bbox);
- else {
+ else { //no Overlaps support yet
throw new UnsupportedSpatialOperation(op);
}
return spatial;
diff --git a/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java b/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
index 6e2ef3478ba..23e0191b815 100644
--- a/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
+++ b/lucene/spatial/src/test/org/apache/lucene/spatial/bbox/TestBBoxStrategy.java
@@ -22,6 +22,7 @@ import com.spatial4j.core.shape.Shape;
import org.apache.lucene.spatial.SpatialMatchConcern;
import org.apache.lucene.spatial.StrategyTestCase;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
@@ -42,7 +43,7 @@ public class TestBBoxStrategy extends StrategyTestCase {
return shape.getBoundingBox();
}
- @Test
+ @Test @Ignore("Overlaps not supported")
public void testBasicOperaions() throws IOException {
getAddAndVerifyIndexedDocuments(DATA_SIMPLE_BBOX);