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

date's format updateability is trappy #25271

Closed
jpountz opened this issue Jun 16, 2017 · 1 comment
Closed

date's format updateability is trappy #25271

jpountz opened this issue Jun 16, 2017 · 1 comment
Labels
>bug help wanted adoptme :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@jpountz
Copy link
Contributor

jpountz commented Jun 16, 2017

Here is a recreation:

DELETE index

PUT index
{
  "mappings": {
    "doc": {
      "properties": {
        "my_date": {
          "type": "date", 
          "format": "yyyy/MM/dd"
        }
      }
    }
  }
}

PUT index/_mapping/doc
{
  "doc": {
    "properties": {
      "my_date": {
        "type": "date", 
        "format": "yyyy-MM-dd"
      }
    }
  }
}

GET index/_mapping

date allows its format to be updated. This is trappy because then it could be changed to a format that doesn't work with already indexed documents, or even worse: a format that parses to a different date.

I think we need to ensure that the format either cannot be changed, or make it a list that is append-only so that it is only possible to append date formats.

@jpountz jpountz added :Search Foundations/Mapping Index mappings, including merging and defining field types >bug discuss labels Jun 16, 2017
@s1monw
Copy link
Contributor

s1monw commented Jun 16, 2017

++ to move to an append-able list! we discussed this in fixit friday and we are convinced that we should not move to a list due to the ordering aspects. If we'd allow only adding to it but not sending the list is that we need to barf if the order changes which is weird. The right fix here is to make the date immutable and reject any updates to it.

@jpountz jpountz added help wanted adoptme and removed discuss labels Jun 16, 2017
PnPie added a commit to PnPie/elasticsearch that referenced this issue Jun 18, 2017
Make date field mapping unchangeable.

Closes elastic#25271
jpountz pushed a commit that referenced this issue Jul 7, 2017
Make date field mapping unchangeable.

Closes #25271
jpountz pushed a commit that referenced this issue Jul 7, 2017
Make date field mapping unchangeable.

Closes #25271
@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 help wanted adoptme :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

3 participants