-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Refactor Spatial Field Mappers #55621
Conversation
This commit refactors all spatial Field Mappers to a common AbstractGeometryFieldMapper that implements shared parameter functionality (e.g., ignore_malformed, ignore_z_value) and provides a common framework for overriding type parsing, and building in xpack. Common shape functionality is implemented in a new AbstractShapeGeometryFieldMapper that is reused and overridden in GeoShapeFieldMapper, GeoShapeFieldMapperWithDocValues, LegacyGeoShapeFieldMapper, and ShapeFieldMapper. This abstraction provides a reusable foundation for adding new xpack features; such as coordinate reference system support.
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
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.
I love this change, it is awesome that all our geo fields inherit from the same subclass. I would like to explore the use of generics in AbstractGeometryFieldParser.TypeParser
to avoid casting on the subclasses, otherwise +1
server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.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.
I like the hierarchy unification as well. thanks for that.
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
This commit refactors all spatial Field Mappers to a common AbstractGeometryFieldMapper that implements shared parameter functionality (e.g., ignore_malformed, ignore_z_value) and provides a common framework for overriding type parsing, and building in xpack. Common shape functionality is implemented in a new AbstractShapeGeometryFieldMapper that is reused and overridden in GeoShapeFieldMapper, GeoShapeFieldMapperWithDocValues, LegacyGeoShapeFieldMapper, and ShapeFieldMapper. This abstraction provides a reusable foundation for adding new xpack features; such as coordinate reference system support.
This PR refactors all spatial Field Mappers to a common
AbstractGeometryFieldMapper
that implements shared parameter functionality (e.g.,ignore_malformed
,ignore_z_value
) and provides a common framework for overriding type parsing, and building in xpack. Common shape functionality is implemented in a newAbstractShapeGeometryFieldMapper
that is reused and overridden inGeoShapeFieldMapper
,GeoShapeFieldMapperWithDocValues
,LegacyGeoShapeFieldMapper
, andShapeFieldMapper
, respectively. This abstraction provides a reusable foundation for adding new xpack features; such as coordinate reference system support.