Change timestamp format for existing index

I read the date time is one of the only mappings that can be altered for an existing index. I'm attempting to alter the date format as follows:

curl http://localhost:9200/web/_mapping/_timestamp?include_type_name=true -X PUT --header "Content-Type: application/json" -d "`cat thing`"

{
  "timestamp": {
    "properties": {
      "format": "basic_date_time_no_millis"
    }
  }
}

The Elasticsearch API is giving me:

{
  "error": {
    "root_cause": [
      {
        "type": "mapper_parsing_exception",
        "reason": "Root mapping definition has unsupported parameters:  [timestamp : {properties={format=basic_date_time_no_millis}}]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "Root mapping definition has unsupported parameters:  [timestamp : {properties={format=basic_date_time_no_millis}}]"
  },
  "status": 400
}

What am I doing wrong?

this used to work in earlier versions of elasticsearch, but due to issues this has been removed in more recent versions.

Creating a new index with the new mapping and reindexing sounds like the best approach here to me.

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