OpenSearch Version 2.3.0
Using copy_to parameter; copying a field value of type geo_point (in a nested document) to another mapped field of type geo_point at the document root fails. When we remove the referenced field mapping from the root, the copy_to succeeds. The source field is (in fact) of type geo_point and works very well in our geospatial queries.
Exception that occurs:
type: mapper_parsing_exception,
reason: failed to parse field [coordinates] of type [geo_point],
caused by:
type: parse_exception
reason: geo_point expected
pablo
November 4, 2023, 1:55pm
2
@maxfriz Did that ever work for you?
According to ElasticSearch GitHub, copy_to doesn’t support geo_point type object. The following issue was reported for ES 7.4
opened 11:26PM - 19 Nov 19 UTC
closed 11:27AM - 11 May 21 UTC
>enhancement
:Search/Mapping
Team:Search
**Elasticsearch version** (`bin/elasticsearch --version`): 7.4.2
**Descriptio… n of the problem including expected versus actual behavior**:
Using `copy_to` with a `date_range` field causes errors on ingest. Interestingly (worse?), if you define a field that is not mapped and mappings are disabled, then it silently ignores the `copy_to` request.
**Steps to reproduce**:
1\. Create the index
```http
PUT /test
{
"mappings": {
"properties": {
"date_copy": {
"type": "date_range"
},
"date": {
"type": "date_range",
"copy_to": "date_copy"
}
}
}
}
```
2\. Attempt to index a document.
```http
PUT /test/_doc/1
{
"date": {
"gte": "2019-11-10T01:00:00.000Z",
"lt": "2020-01-01"
}
}
```
3\. Observe error.
```json
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "error parsing field [date_copy], expected an object but got date"
}
],
"type": "mapper_parsing_exception",
"reason": "failed to parse field [date_copy] of type [date_range] in document with id '1'. Preview of field's value: 'null'",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "error parsing field [date_copy], expected an object but got date"
}
},
"status": 400
}
```
This is still valid for the latest version of 8.10
OpenSearch is a fork of ES 7.10.2