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

the high order template can not overwrite the lower order template #73754

Closed
nshfany opened this issue Jun 4, 2021 · 2 comments
Closed

the high order template can not overwrite the lower order template #73754

nshfany opened this issue Jun 4, 2021 · 2 comments
Labels
>bug needs:triage Requires assignment of a team area label

Comments

@nshfany
Copy link

nshfany commented Jun 4, 2021

hello!
Elasticsearch version : elasticsearch 6.8.15

Steps to reproduce:

  1. defined two template
    PUT _template/test_1 { "order":1, "index_patterns" : [ "test_*" ], "mappings":{ "_doc":{ "properties":{ "name":{ "ignore_above" : 10922, "type" : "keyword" } } } } }
    PUT _template/test { "order":0, "index_patterns" : [ "test*" ], "mappings":{ "_doc":{ "properties":{ "name":{ "ignore_above" : 10922, "type" : "keyword", "index":false } } } } }
  2. write two index test and test_1
    PUT test/_doc/1 { "name":"Tom" }
    PUT test_1/_doc/1 { "name":"Tom" }
  3. get the two index test and test_1
    GET test/_mapping
    GET test_1/_mapping
  4. the mapping of index test_1 is match the template test

the elasticsearch server has not any the error message!

@nshfany nshfany added >bug needs:triage Requires assignment of a team area label labels Jun 4, 2021
@dakrone
Copy link
Member

dakrone commented Jun 4, 2021

@nshfany legacy index templates (the ones used here) are merged, which is why test_1 matches both templates. This is one of the downsides of legacy templates and has been addressed by composable index templates (#53101) released in 7.9+

Since this behavior is not a bug, I'm going to close this issue.

@dakrone dakrone closed this as completed Jun 4, 2021
@nshfany
Copy link
Author

nshfany commented Jun 5, 2021

@nshfany legacy index templates (the ones used here) are merged, which is why test_1 matches both templates. This is one of the downsides of legacy templates and has been addressed by composable index templates (#53101) released in 7.9+

Since this behavior is not a bug, I'm going to close this issue.

Oh~ thanks! This is a fantastic idea! The problem has been solved satisfactorily by the function of V2 template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug needs:triage Requires assignment of a team area label
Projects
None yet
Development

No branches or pull requests

2 participants