Mapping - error illegal_argument_exception when defining new date forma

Kibana + Elastic version: 6.2.4
JDK version: 10.0.1
OS version: Win10

Hi,
I'm new to this world so please be gentle :slight_smile:

when trying to add a date format, I generated both queries:
this one worked:
put /product/default/_mapping
{
"properties": {
"created": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
}
}
}

this one didn't work:

PUT /product/default/_mapping
{
"properties": {
"created": {
"type": "date",
"format": "yyyy/MM/dd HH:mm:ss||yyyy/MM/dd"
}
}
}

the only difference is the date format, which i don't understand why for the second i get the below error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "Mapper for [created] conflicts with existing mapping in other types:\n[mapper [created] has different [format] values]"
}
],
"type": "illegal_argument_exception",
"reason": "Mapper for [created] conflicts with existing mapping in other types:\n[mapper [created] has different [format] values]"
},
"status": 400
}

thanks!!

You can't change an existing mapping.
You need to delete and recreate again the index.

I moved your post to #elasticsearch

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.