-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Description
In support of the upcoming geo_shape doc values and aggregation feature (licensed Basic). The doc_values field mapper parameter needs to be available in both GeoShapeFieldMapper and ShapeFieldMapper when the spatial xpack module is loaded, and the basic license is available. If the spatial xpack module is not available, existing OSS behavior should remain the same (e.g., MapperParsingException when doc_values parameter is explicitly provided by the user).
This issue will capture discussion and track progress on the design and implementation for overriding doc_values field mapper parameter through the Spatial x-pack module.
The Spatial Doc Value Parameter Feature Branch is available for review and discussion and provides the following behavior:
- if the Spatial xpack module is available the
doc_valuesparameter defaults totrueforGeoShapeFieldMapperandShapeFieldMapper - if the spatial xpack module is available the
doc_valuesparameter throws an Exception for newgeo_shapefields defined using the legacy PrefixTree indexing approach (same behavior as before) - if the Spatial xpack module is not available (e.g., OSS) the
doc_valuesparameter defaults tofalseforGeoShapeFieldMapperandShapeFieldMapper(same behavior as before) - if the spatial xpack module is not available (e.g., OSS) explicitly setting the
doc_valuesparameter throws aMapperParsingException(same behavior as before) - backwards compatibility is supported
The behavior is achieved using the following "hack":
- a new
GeoShapeFieldMapper.Extensionis loaded through SPI that overrides theGeometryIndexerthat adds theindexDocValueslogic - a new
AbstractGeometryFieldMapper.ParserExtensionis loaded through SPI that supplementsTypeParser.parselogic to parse thedoc_valuesparameter in the spatial xpack module IndicesModule.javais "hacked" to load theParserExtensionandDataLoaderobjects from xpack that provides the overriding behavior described above