Skip to content

Incorrect results of ES|QL query for point field nested in object #125710

Open
@lkts

Description

@lkts

Elasticsearch Version

9.1 and earlier

Installed Plugins

No response

Java Version

bundled

OS Version

Problem Description

If you create a document with an object array and a point field using array form inside, it is not possible to use such field in a ES|QL query. Using specifically an array form and having multiple values of the field is crucial for the reproduction. See the steps below. This also applies to geo_point.

Steps to Reproduce

PUT my-index
{
  "mappings": {
    "properties": {
      "top": {
        "properties": {
          "p": {
            "type": "point"
          }
        }
      }
    }
  }
}

POST my-index/_bulk?refresh
{ "create": {} }
{ "top": [{"p": [-71.34, 41.12]}, {"p": "POINT (-71.34 41.13)"}] }

POST /_query?format=txt
{
  "query": "FROM my-index"
}

Produces:

     top.p     
---------------
null           

But should produce:

                   top.p                    
--------------------------------------------
[POINT (-71.34 41.12), POINT (-71.34 41.13)]

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions