elastic / elastic/elasticsearch

Loading docvalue_fields for geopoints can give incorrect result

Open
#55,993 2 comments 0 reactions 0 assignees View on GitHub
:Analytics/Geo >bug Team:Analytics
Dominant language
Java
Stars
77.9k
Forks
26.1k
PR merge metrics
PR metrics pending

Description

If a document has a multi-valued geopoint field, the result of `docvalue_fields` will append all the lat and lon values into a single array. The following example reproduces on version 7.6.

```
PUT index
{
"mappings": {
"properties": {
"locations": {
"type": "geo_point"
}
}
}
}

PUT index/_doc/1
{
"locations": [[ -71.34, 41.12 ], [ -71.34, 42.89 ]]
}

POST index/_search
{
"docvalue_fields": ["locations"]
}
```

Response:
```
{
"_index" : "index",
...
"fields" : {
"locations" : [
-71.33999633789062,
-71.33999633789062,
41.119998931884766,
42.88999938964844
]
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.