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

Mapping not applied to new index after rollover #45399

Closed
Incara opened this issue Aug 9, 2019 · 3 comments
Closed

Mapping not applied to new index after rollover #45399

Incara opened this issue Aug 9, 2019 · 3 comments
Assignees
Labels
>bug :Data Management/Indices APIs APIs to create and manage indices and templates :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@Incara
Copy link

Incara commented Aug 9, 2019

Version 7.2.0

Plugins installed: [none]

OS version: Linux 4.1.12-124.28.6.el7uek.x86_64

Description of the problem including expected versus actual behavior:

When calling _rollover with a supplied mapping, it is not applied to the new index. Issue first noticed in the Rest High Level Client, but present when directly making requests. Expected behavior is that mappings would be applied. Settings are correctly applied.

Steps to reproduce:

  1. PUT test-index

  2. POST _aliases

{
  "actions": [
    {
      "add": {
        "index": "test-index",
        "alias": "test-alias"
      }
    }
  ]
}
  1. POST test-alias/_rollover/new-test-index
{
  "settings": {
    "index": {
      "mapping": {
        "coerce": "false"
      }
    }
  },
  "mappings": {
    "dynamic": "false",
    "properties": {
      "someProperty": {
        "properties": {
          "value": {
            "type": "keyword"
          }
        }
      }
    }
  },
  "aliases": {},
  "conditions": {
    "max_docs": 0
  }
}

Note: If I use the same settings and mapping content above to manually PUT an index, it works correctly

  1. GET test-alias/_settings, validate setting present

  2. GET test-alias/_mappings

{
  "new-test-index": {
   "mappings": { }
  }
}

Workaround: Manually apply the mappings to the index after rollover happens.

@dnhatn dnhatn added the :Data Management/Indices APIs APIs to create and manage indices and templates label Aug 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@jtibshirani jtibshirani added the :Search Foundations/Mapping Index mappings, including merging and defining field types label Aug 9, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jtibshirani jtibshirani self-assigned this Aug 9, 2019
@jtibshirani
Copy link
Contributor

Thank you @Incara for reporting this issue! I just opened #45411 to address it.

I also wanted to mention another workaround -- it is common to define an index template that matches the indices. When rolling over to a new index, mappings from matching index templates will be automatically applied.

@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 :Data Management/Indices APIs APIs to create and manage indices and templates :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