You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2017/11/22 16:08:15 UTC
[1/2] lucene-solr:master: LUCENE-8057: getBounds() for exact circle
did not include segment endpoints.
Repository: lucene-solr
Updated Branches:
refs/heads/master 9b52571d8 -> 26cbf520d
LUCENE-8057: getBounds() for exact circle did not include segment endpoints.
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9776e1f4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9776e1f4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9776e1f4
Branch: refs/heads/master
Commit: 9776e1f4a0a6dc085c47c2204f4032d3f9e947aa
Parents: d0d8a75
Author: Karl Wright <Da...@gmail.com>
Authored: Wed Nov 22 11:07:52 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Wed Nov 22 11:07:52 2017 -0500
----------------------------------------------------------------------
.../lucene/spatial3d/geom/GeoExactCircle.java | 7 ++++++-
.../lucene/spatial3d/geom/GeoCircleTest.java | 19 ++++++++++++++++++-
2 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9776e1f4/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
index bbd1ff0..8bba244 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
@@ -356,8 +356,13 @@ class GeoExactCircle extends GeoBaseCircle {
return;
}
// Add bounds for all circle planes
- for (final SidedPlane plane : circlePlanes) {
+ for (int edgeIndex = 0; edgeIndex < circlePlanes.size(); edgeIndex++) {
+ final SidedPlane plane = circlePlanes.get(edgeIndex);
bounds.addPlane(planetModel, plane, eitherBounds.get(plane));
+ final GeoPoint[] points = notableEdgePoints.get(edgeIndex);
+ for (final GeoPoint point : points) {
+ bounds.addPoint(point);
+ }
// We don't bother to compute the intersection bounds since, unless the planet model is pathological, we expect planes to be intersecting at shallow
// angles.
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9776e1f4/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
index d203b09..3f35ef3 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
@@ -533,5 +533,22 @@ public class GeoCircleTest extends LuceneTestCase {
assertTrue(bBox.getRelationship(circle) == GeoArea.OVERLAPS);
}
-
+ @Test
+ public void testExactCircleBounds() {
+
+ GeoPoint center = new GeoPoint(PlanetModel.WGS84, 0, 0);
+ // Construct four cardinal points, and then we'll build the first two planes
+ final GeoPoint northPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, 0.0);
+ final GeoPoint southPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI);
+ final GeoPoint eastPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 0.5);
+ final GeoPoint westPoint = PlanetModel.WGS84.surfacePointOnBearing(center, 1, Math.PI * 1.5);
+
+ GeoCircle circle = GeoCircleFactory.makeExactGeoCircle(PlanetModel.WGS84, 0, 0, 1, 1e-6);
+ LatLonBounds bounds = new LatLonBounds();
+ circle.getBounds(bounds);
+ assertEquals(northPoint.getLatitude(), bounds.getMaxLatitude(), 1e-2);
+ assertEquals(southPoint.getLatitude(), bounds.getMinLatitude(), 1e-2);
+ assertEquals(westPoint.getLongitude(), bounds.getLeftLongitude(), 1e-2);
+ assertEquals(eastPoint.getLongitude(), bounds.getRightLongitude(), 1e-2);
+ }
}
[2/2] lucene-solr:master: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/lucene-solr
Posted by kw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/26cbf520
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/26cbf520
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/26cbf520
Branch: refs/heads/master
Commit: 26cbf520d574a37c59b61962a85a847a07bc2af9
Parents: 9776e1f 9b52571
Author: Karl Wright <Da...@gmail.com>
Authored: Wed Nov 22 11:08:08 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Wed Nov 22 11:08:08 2017 -0500
----------------------------------------------------------------------
solr/CHANGES.txt | 19 +++++
.../apache/solr/parser/SolrQueryParserBase.java | 29 ++++++-
.../solr/search/ExtendedDismaxQParser.java | 90 ++------------------
.../java/org/apache/solr/search/Grouping.java | 2 +-
.../org/apache/solr/search/LuceneQParser.java | 1 +
.../apache/solr/search/NestedQParserPlugin.java | 5 ++
.../java/org/apache/solr/search/QParser.java | 56 +++++++-----
.../join/ChildFieldValueSourceParser.java | 4 +-
.../apache/solr/DisMaxRequestHandlerTest.java | 20 +++++
.../apache/solr/highlight/HighlighterTest.java | 2 +-
.../apache/solr/search/QueryEqualityTest.java | 2 +-
.../search/TestComplexPhraseQParserPlugin.java | 10 +++
.../solr/search/TestExtendedDismaxParser.java | 36 ++++++--
.../org/apache/solr/search/TestQueryTypes.java | 2 +-
14 files changed, 160 insertions(+), 118 deletions(-)
----------------------------------------------------------------------