Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't change date format on existing properties #33986

Closed
weberhofer opened this issue Sep 24, 2018 · 3 comments
Closed

Can't change date format on existing properties #33986

weberhofer opened this issue Sep 24, 2018 · 3 comments
Labels
>bug >docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@weberhofer
Copy link

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?

@colings86 colings86 added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Sep 24, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@danielmitterdorfer
Copy link
Member

Thanks for raising the issue! This was changed (intentionally) in #25285, see also the related issue #25271 for the reasoning. So IMHO the docs are outdated and need to be fixed.

@danielmitterdorfer danielmitterdorfer added >bug >docs General docs changes help wanted adoptme labels Sep 24, 2018
@weberhofer
Copy link
Author

Thanks for notifying me. And, yes, documentation should be fixed.

danielmitterdorfer added a commit to danielmitterdorfer/elasticsearch that referenced this issue Sep 24, 2018
With this commit we remove a leftover in the docs about the `format`
field being updateable. This is not true since we removed support for
updates in elastic#25285.

Closes elastic#33986
Relates elastic#25285
danielmitterdorfer added a commit that referenced this issue Sep 25, 2018
With this commit we remove a leftover in the docs about the `format`
field being updatable. This is not true since we removed support for
updates in #25285.

Closes #33986
Relates #25285
Relates #34006
danielmitterdorfer added a commit that referenced this issue Sep 25, 2018
With this commit we remove a leftover in the docs about the `format`
field being updatable. This is not true since we removed support for
updates in #25285.

Closes #33986
Relates #25285
Relates #34006
danielmitterdorfer added a commit that referenced this issue Sep 25, 2018
With this commit we remove a leftover in the docs about the `format`
field being updatable. This is not true since we removed support for
updates in #25285.

Closes #33986
Relates #25285
Relates #34006
kcm pushed a commit that referenced this issue Oct 30, 2018
With this commit we remove a leftover in the docs about the `format`
field being updatable. This is not true since we removed support for
updates in #25285.

Closes #33986
Relates #25285
Relates #34006
@javanna javanna added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug >docs General docs changes :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants