-
Notifications
You must be signed in to change notification settings - Fork 25.3k
[SPATIAL] New ShapeQueryBuilder for querying indexed cartesian geometry #45108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This commit adds a new ShapeQueryBuilder to the xpack spatial module for querying arbitrary cartesian geometries indexed using the new shape field type. The query builder extends AbstractGeometryQueryBuilder and leverages the ShapeQueryProcessor added in the previous field mapper commit. Tests are provided in `ShapeQueryTests` in the same manner as GeoShapeQueryTests and docs are updated to explain how the query works.
Pinging @elastic/es-analytics-geo |
test/framework/src/main/java/org/elasticsearch/geo/GeometryTestUtils.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/spatial/src/test/java/org/apache/lucene/geo/XShapeTestUtil.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. I am fine with code, but there are some issues with packaging that we need to figure out.
test/framework/src/main/java/org/elasticsearch/geo/GeometryTestUtils.java
Outdated
Show resolved
Hide resolved
...gin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/query/ShapeQueryBuilder.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
…ry (elastic#45108) This commit adds a new ShapeQueryBuilder to the xpack spatial module for querying arbitrary Cartesian geometries indexed using the new shape field type. The query builder extends AbstractGeometryQueryBuilder and leverages the ShapeQueryProcessor added in the previous field mapper commit. Tests are provided in ShapeQueryTests in the same manner as GeoShapeQueryTests and docs are updated to explain how the query works.
…45363) * Introduce Spatial Plugin (#44389) Introduce a skeleton Spatial plugin that holds new licensed features coming to Geo/Spatial land! * [GEO] Refactor DeprecatedParameters in AbstractGeometryFieldMapper (#44923) Refactor DeprecatedParameters specific to legacy geo_shape out of AbstractGeometryFieldMapper.TypeParser#parse. * [SPATIAL] New ShapeFieldMapper for indexing cartesian geometries (#44980) Add a new ShapeFieldMapper to the xpack spatial module for indexing arbitrary cartesian geometries using a new field type called shape. The indexing approach leverages lucene's new XYShape field type which is backed by BKD in the same manner as LatLonShape but without the WGS84 latitude longitude restrictions. The new field mapper builds on and extends the refactoring effort in AbstractGeometryFieldMapper and accepts shapes in either GeoJSON or WKT format (both of which support non geospatial geometries). Tests are provided in the ShapeFieldMapperTest class in the same manner as GeoShapeFieldMapperTests and LegacyGeoShapeFieldMapperTests. Documentation for how to use the new field type and what parameters are accepted is included. The QueryBuilder for searching indexed shapes is provided in a separate commit. * [SPATIAL] New ShapeQueryBuilder for querying indexed cartesian geometry (#45108) Add a new ShapeQueryBuilder to the xpack spatial module for querying arbitrary Cartesian geometries indexed using the new shape field type. The query builder extends AbstractGeometryQueryBuilder and leverages the ShapeQueryProcessor added in the previous field mapper commit. Tests are provided in ShapeQueryTests in the same manner as GeoShapeQueryTests and docs are updated to explain how the query works.
This PR adds a new
ShapeQueryBuilder
to the xpackspatial
module forquerying arbitrary cartesian geometries indexed using the new
shape
fieldtype.
The query builder extends
AbstractGeometryQueryBuilder
and leverages theShapeQueryProcessor
added in the previous field mapper commit.Tests are provided in
ShapeQueryTests
andShapeQueryBuilderTests
in thesame manner as
GeoShapeQueryTests
andGeoShapeQueryBuilderTests
,respectively.
Docs are also updated to explain how the query works and how to use it.
relates #44980