elastic / elastic/elasticsearch
Loading docvalue_fields for geopoints can give incorrect result
- 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
Assessment
This issue has not been assessed yet.