Skip to content

Can't change date format on existing properties #33986

@weberhofer

Description

@weberhofer

Elasticsearch version
6.4.1

Plugins installed: []

JVM version
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (IcedTea 3.8.0) (build 1.8.0_171-b11 suse-24.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

OS version (uname -a if on a Unix-like system):
Linux herkules 4.4.143-65-default #1 SMP Tue Aug 14 09:18:29 UTC 2018 (4e090cc) x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
The doc says "The format setting can be updated on existing fields using the PUT mapping API." which does not work for me.

Steps to reproduce:
I have the following property defined in my index:

"changeDate": {
  "type": "date",
  "store": true,
  "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd"
}

To allow an additional date format I want to send an update to the index:
PUT http://herkules:9200/myindex/_mapping/docs

{
  "properties" :{
    "changeDate": {
      "type": "date",
      "format": "yyyy-MM-dd HH:mm:ss||strict_date||strict_date_hour_minute_second",
      "store": true
    }
  }
}

I expect elastic to accespt this, but all I get ist a HTTP 400 saying:

{
"type": "illegal_argument_exception",
"reason": "Mapper for [changeDate] conflicts with existing mapping in other types:\n[mapper [changeDate] has different [format] values]"
}

Shouldn't that work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Search Foundations/MappingIndex mappings, including merging and defining field types>bug>docsGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions