Updating nested date field format fails in 2.2.1


(Peteradh) #1

I currently run tests after migrating our dev system from ES 1.6.0 to 2.2.1. After migration, all 'date' fields still have "format": "dateOptionalTime" and I now need to update that to "format": "strict_date_optional_time||epoch_millis" to be able to index new data into existing indices using logstash.

I update the format as described here: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html

PUT my_index/_mapping/my_type?update_all_types
{
"properties": {
"my_field": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}

Using this for a 'normal' field is fine (although 'update_all_types' does not work and I have to update each field individually - but this appears to be issue #16239).

Now I want to update a nested field, which I normally would address as 'my_field.my_subfield'. But

PUT my_index/_mapping/my_type?update_all_types
{
"properties": {
"my_field.my_subfield": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}

raises this:

{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Field name [my_field.my_subfield] cannot contain '.'"
}
],
"type": "mapper_parsing_exception",
"reason": "Field name [my_field.my_subfield] cannot contain '.'"
},
"status": 400
}

I understand that from 2.0 onwards, field names may no longer contain a dot in their name - but this is no field with a dot in the name but a nested field. Any ideas how to update that other than by the dot notation?


(system) #2