Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Field exists query broken for GeoShape fields after upgrade (from 2.8.0 to 2.11.1) #11746

Open
Pierre-Hugues opened this issue Jan 4, 2024 · 1 comment

Comments

@Pierre-Hugues
Copy link

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

  1. Start an OpenSearch server in version 2.8.0
  2. Create an index with a geo_shape field
PUT old_index
{
    "mappings": {
        "properties": {
            "name": { "type": "text" },
            "my_geometry": { "type": "geo_shape" }
        }
    }
}
  1. 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]
  }
}
  1. Check that the "Field exists" filter works on this version
GET old_index/_search
{
  "query": {
      "bool": { "must_not": { "exists": { "field": "my_geometry" }}}
  }
}
  1. Upgrade the OpenSearch server to version 2.11.1

  2. 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 structures

The 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
@dblock
Copy link
Member

dblock commented Jan 9, 2024

If you have time, try to turn this into a (failing) YAML test?

@getsaurabh02 getsaurabh02 moved this from 🆕 New to Later (6 months plus) in Search Project Board Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Later (6 months plus)
Development

No branches or pull requests

3 participants