-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for geo_bounding_box queries on geo_shape fields (#2506)
Adds support for using geo_bounding_box queries on geo_shape field types by lifting the geo_point restriction in the QueryBuilder. Bounding Box query integration tests are abstracted to test both geo_point and geo_shape types. Signed-off-by: Nicholas Walter Knize <[email protected]>
- Loading branch information
Showing
5 changed files
with
108 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...rc/internalClusterTest/java/org/opensearch/search/geo/GeoBoundingBoxQueryGeoPointsIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.search.geo; | ||
|
||
import org.opensearch.common.xcontent.XContentBuilder; | ||
|
||
import java.io.IOException; | ||
|
||
public class GeoBoundingBoxQueryGeoPointsIT extends AbstractGeoBoundingBoxQueryIT { | ||
|
||
@Override | ||
public XContentBuilder addGeoMapping(XContentBuilder parentMapping) throws IOException { | ||
return parentMapping.startObject("location").field("type", "geo_point").endObject(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...rc/internalClusterTest/java/org/opensearch/search/geo/GeoBoundingBoxQueryGeoShapesIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.search.geo; | ||
|
||
import org.opensearch.common.xcontent.XContentBuilder; | ||
|
||
import java.io.IOException; | ||
|
||
public class GeoBoundingBoxQueryGeoShapesIT extends AbstractGeoBoundingBoxQueryIT { | ||
|
||
@Override | ||
public XContentBuilder addGeoMapping(XContentBuilder parentMapping) throws IOException { | ||
parentMapping = parentMapping.startObject("location").field("type", "geo_shape"); | ||
if (randomBoolean()) { | ||
parentMapping.field("strategy", "recursive"); | ||
} | ||
return parentMapping.endObject(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.