[BUG] Field exists query broken for GeoShape fields after upgrade (from 2.8.0 to 2.11.1)
Author: Pierre-HuguesCreated Jan 4, 2024Updated Sep 17, 2026
LabelsbugGeospatialSearch:Query Capabilities
Describe the bug
"Field exists" query does not work properly on fields GeoShape for existing indexes after the upgrade from 2.8.0 version to 2.11.1 I suspect it is related to #10958 somehow
Related component
Search:Query Capabilities
To Reproduce
- Start an OpenSearch server in version 2.8.0
- Create an index with a
geo_shapefield
PUT old_index
{
"mappings": {
"properties": {
"name": { "type": "text" },
"my_geometry": { "type": "geo_shape" }
}
}
}- Add some documents to it
POST old_index/_doc/1
{
"name" : "Without geometry"
}
POST old_index/_doc/2
{
"name" : "With geometry",
"my_geometry": {
"type": "Point",
"coordinates": [1,1]
}
}- Check that the "Field exists" filter works on this version
GET old_index/_search
{
"query": {
"bool": { "must_not": { "exists": { "field": "my_geometry" }}}
}
}Upgrade the OpenSearch server to version 2.11.1
Do the same search as before
GET old_index/_search
{
"query": {
"bool": { "must_not": { "exists": { "field": "my_geometry" }}}
}
}Expected behavior
The current result is the following failure :
FieldExistsQuery requires that the field indexes doc values, norms or vectors, but field 'my_geometry' exists and indexes neither of these data structuresThe expected result is that the filter works properly and only returns the following document :
{
"name" : "Without geometry"
}If we re-create a fresh new index on this 2.11.1 version following the same steps as before, then the filter works fine.
Additional Details
Host/Environment : Initially had the issue with :
- Index initially created on version
1.3.5 - OpenSearch version before upgrade
2.8.0 - OpenSearch version after upgrade
2.11.1=> result: I did not have any error message with this setup, but the responses were wrong, and the filter was not applying (ignored?)
Reproduced locally (dockerized) with :
- Index Initially created on version
2.8.0 - OpenSearch version before upgrade
2.8.0 - OpenSearch version after upgrade
2.11.1=> result: a 500 error, with the message above
Source: opensearch-project/OpenSearch