Description
Elasticsearch version (bin/elasticsearch --version
): 7.7.1 and 7.6.2. I'm currently using Docker with image: docker.elastic.co/elasticsearch/elasticsearch:7.7.1
Plugins installed: []
JVM version (java -version
): Returns nothing in Docker container.
OS version (uname -a
if on a Unix-like system): Linux 1a0ec47b8a82 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Description of the problem including expected versus actual behavior:
You update a date format mapping from "dateOptionalTime" to "date_optional_time".
Expected: As in 7.5.2, the update is successful since both format strings are interchangeable.
Actual: In 7.6.2 and 7.7.1, an error is raised about "conflicts with existing mapping" (see below).
We always update mappings with "dateOptionalTime" but the mappings somehow got changed to "date_optional_time" recently (probably when upgrading from 7.5.2 -> 7.6.2). We ran into this error when updating mappings as we usually do.
Steps to reproduce:
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test
curl -XPUT localhost:9200/test/_mapping -H 'Content-Type: application/json' -d'{ "properties": { "created_at": { "type": "date", "format": "dateOptionalTime" } }}'
curl -XPUT localhost:9200/test/_mapping -H 'Content-Type: application/json' -d'{ "properties": { "created_at": { "type": "date", "format": "date_optional_time" } }}'
Error on last command:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": """Mapper for [created_at] conflicts with existing mapping:
[mapper [created_at] has different [format] values]"""
}
],
"type": "illegal_argument_exception",
"reason": """Mapper for [created_at] conflicts with existing mapping:
[mapper [created_at] has different [format] values]"""
},
"status": 400
}