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

Process dynamic templates in order. #18638

Merged
merged 1 commit into from
May 31, 2016

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented May 30, 2016

When calling findTemplateBuilder(context, currentFieldName, "text", null),
elasticsearch ignores all templates that have a match_mapping_type set since
no dynamic type is provided (the last parameter, which is null in that case).
So this should only be called last. Otherwise, if a path-based template
matches, it will have precedence over all type-based templates.

Closes #18625
Closes #2401

@jpountz jpountz added review :Search Foundations/Mapping Index mappings, including merging and defining field types v2.4.0 v5.0.0-alpha4 labels May 30, 2016
if (builder != null) {
return builder;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code was initially added to fix #1418. But I checked and the bug does not reproduce without this block of code with recent versions of Jackson.

@s1monw
Copy link
Contributor

s1monw commented May 30, 2016

I looked at it and I think I understand what's going on so LGTM but I think @rjernst should also look

@rjernst
Copy link
Member

rjernst commented May 30, 2016

LGTM too

When calling `findTemplateBuilder(context, currentFieldName, "text", null)`,
elasticsearch ignores all templates that have a `match_mapping_type` set since
no dynamic type is provided (the last parameter, which is null in that case).
So this should only be called _last_. Otherwise, if a path-based template
matches, it will have precedence over all type-based templates.

Closes elastic#18625
@jpountz jpountz force-pushed the fix/process_templates_in_order branch from d2994b5 to 9570fea Compare May 31, 2016 07:00
@jpountz jpountz merged commit 9570fea into elastic:master May 31, 2016
jpountz added a commit that referenced this pull request May 31, 2016
When calling `findTemplateBuilder(context, currentFieldName, "text", null)`,
elasticsearch ignores all templates that have a `match_mapping_type` set since
no dynamic type is provided (the last parameter, which is null in that case).
So this should only be called _last_. Otherwise, if a path-based template
matches, it will have precedence over all type-based templates.

Closes #18625
@jpountz jpountz removed the review label May 31, 2016
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 v2.4.0 v5.0.0-alpha4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants