Skip to content

Override doc_values parameter in Spatial XPack Module #53263

@nknize

Description

@nknize

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_values parameter defaults to true for GeoShapeFieldMapper and ShapeFieldMapper
  • if the spatial xpack module is available the doc_values parameter throws an Exception for new geo_shape fields defined using the legacy PrefixTree indexing approach (same behavior as before)
  • if the Spatial xpack module is not available (e.g., OSS) the doc_values parameter defaults to false for GeoShapeFieldMapper and ShapeFieldMapper (same behavior as before)
  • if the spatial xpack module is not available (e.g., OSS) explicitly setting the doc_values parameter throws a MapperParsingException (same behavior as before)
  • backwards compatibility is supported

The behavior is achieved using the following "hack":

  • a new GeoShapeFieldMapper.Extension is loaded through SPI that overrides the GeometryIndexer that adds the indexDocValues logic
  • a new AbstractGeometryFieldMapper.ParserExtension is loaded through SPI that supplements TypeParser.parse logic to parse the doc_values parameter in the spatial xpack module
  • IndicesModule.java is "hacked" to load the ParserExtension and DataLoader objects from xpack that provides the overriding behavior described above

Metadata

Metadata

Labels

:Analytics/GeoIndexing, search aggregations of geo points and shapesTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions