-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Analytics/GeoIndexing, search aggregations of geo points and shapesIndexing, search aggregations of geo points and shapes>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)
Description
Elasticsearch Version
8.15.5
Installed Plugins
No response
Java Version
bundled
OS Version
kubernetes ("name": "Linux","pretty_name": "Ubuntu 20.04.6 LTS","arch": "amd64","version": "5.15.0-156-generic")
Problem Description
Index setup:
we have multiple index inside the system and all have a nested "DU" inside of it, but not all DU have the field "DU.location_position"
Example mapping
{
"entity_xyz": {
"mappings": {
"DU.location_position": {
"full_name": "DU.location_position",
"mapping": {
"location_position": {
"type": "geo_point"
}
}
}
}
}
}
my goal is to replace some deprecated geo_polygon queries with geo_shape queries. And because some of the geo shape can get big, i want to use indexed shapes
old query:
GET /entity_*/_search
{
"query": {
"nested": {
"query": {
"bool": {
"must": [
{
"geo_polygon": {
"DU.location_position": {
"points": [
[
-169.40208435058594,
-3.1404058933258057
],
[
-169.40208435058594,
83.99121856689453
],
[
20.51266860961914,
83.99121856689453
],
[
20.51266860961914,
-3.1404058933258057
],
[
-169.40208435058594,
-3.1404058933258057
]
]
},
**"ignore_unmapped": true**
}
}
]
}
},
"path": "DU"
}
}
}
This is how my new query looks like:
GET /entity_*/_search
{
"query": {
"nested": {
"query": {
"bool": {
"must": [
{
"geo_shape": {
"DU.location_position": {
"indexed_shape": {
"id": "1",
"index": "cached_polygon",
"path": "shape"
},
"relation": "within"
},
**"ignore_unmapped": true**
}
}
]
}
},
"path": "DU"
}
}
}
for all index where the field "DU.location_position" not exists i got an error
"reason": {
"type": "query_shard_exception",
"reason": "failed to find type for field [DU.location_position]",
"index_uuid": "m2vv83hVRWOIoPc_8bqXfQ",
"index": "entity_xyz"
}
Remarks:
- in the old query version with “geo_polygon” the failures are only happening if i set ignore unmapped to false. if i set it to true the failures go away
- i would expect setting “ignore_unmapped” to true would ignore unmapped in the new “geo_shape” like in the old “geo_polygon“
- maybe the problem is triggered because of the "nested" part?
ES version: 8.15.5
Steps to Reproduce
- create index_name1 with a nested document and inside a field of type geo_point
- create index_name2 with a nested document and the field is missing
- execute a geo_shape search over both index (e.g. index_*)
Logs (if relevant)
No response
Metadata
Metadata
Assignees
Labels
:Analytics/GeoIndexing, search aggregations of geo points and shapesIndexing, search aggregations of geo points and shapes>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)