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

Disallow identical dynamic_templates definitions #52062

Closed
wants to merge 2 commits into from

Conversation

cbuescher
Copy link
Member

Currently the same dynamic_templates can be defined more than once by error in
the same mappings file. This most certainly is unintentional and can create
issues like those reported in #28988. This change checks for identical duplicates
while parsing and throws an error if we encounter the same definition twice.

Closes #28988

Currently the same dynamic_templates can be defined more than once by error in
the same mappings file. This most certainly is unintentional and can create
issues like those reported in elastic#28988. This change checks for duplicates while
parsing and throws an error if we encounter the same definition twice.

Closes elastic#28988
@cbuescher cbuescher added >bug :Search Foundations/Mapping Index mappings, including merging and defining field types labels Feb 7, 2020
@cbuescher cbuescher requested a review from jtibshirani February 7, 2020 16:30
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

@cbuescher
Copy link
Member Author

@jtibshirani after your comments on #51817 I marked the original issue for discussion but thought it wouldn't hurt to open this PR as another proposal. I think we can safely disallow definitions that are entirely identical, which we should be able to check at parsing time. The examples given in #29200 (comment) wouldn't be affected by these checks. Let me know what you think...

@cbuescher
Copy link
Member Author

@elasticmachine update branch

@elasticmachine
Copy link
Collaborator

merge conflict between base and head

@jtibshirani
Copy link
Contributor

Thanks @cbuescher, it's nice to know this option is possible. I'll wait to do a detailed review until we discuss #28988.

@cbuescher
Copy link
Member Author

Superseded by #53326

@cbuescher cbuescher closed this Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search Foundations/Mapping Index mappings, including merging and defining field types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic templates should be deduplicated
3 participants