There are 2 important properties about spatial filters created from a Map:
filter.meta.type is set to spatial_filter. Maps uses filter.meta.type to identify spatial filters. Spatial filters are displayed on the map to provide a visual reference of all applied spatial filters.
filter.meta.isMultiIndex is set to true since Elasticsearch Query DSL for the filter is not tied to a single index pattern or field. The Elasticsearch Query DSL is generated in such a way that the filter works for all map layers, regardless of index pattern or spatial field. In the screenshot above a single filter is filtering both layers, even though they are from different index patterns and different spatial fields.
Each layer identifies one or more geo_point or geo_shape fields that is used to display features for that layer
The Elasticsearch Query DSL combines these into a bool.should clause where each field provides a bool.must clause ensuring the spatial field exists and that the document satisfies the spatial filter. Any document matching any of the bool.must clauses allows the bool.should clause to produce a match.
Fixes https://github.com/elastic/kibana/issues/109340, https://github.com/elastic/kibana/issues/107044, and https://github.com/elastic/kibana/issues/136231
Background
In Maps, users can create spatial filters. The filter is added to the Filter bar.
There are 2 important properties about spatial filters created from a Map:
filter.meta.type
is set tospatial_filter
. Maps usesfilter.meta.type
to identify spatial filters. Spatial filters are displayed on the map to provide a visual reference of all applied spatial filters.filter.meta.isMultiIndex
is set to true since Elasticsearch Query DSL for the filter is not tied to a single index pattern or field. The Elasticsearch Query DSL is generated in such a way that the filter works for all map layers, regardless of index pattern or spatial field. In the screenshot above a single filter is filtering both layers, even though they are from different index patterns and different spatial fields.bool.should
clause where each field provides abool.must
clause ensuring the spatial field exists and that the document satisfies the spatial filter. Any document matching any of thebool.must
clauses allows the bool.should clause to produce a match.See https://github.com/elastic/kibana/pull/111897 for closed POV