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

Set strings to be keywords by default #2688

Merged
merged 1 commit into from
Oct 5, 2016

Conversation

tsg
Copy link
Contributor

@tsg tsg commented Oct 5, 2016

This adds a dynamic mapping to all our template files to set strings to be
keywords by default.

Previously we were using the default of text and only switching to keyword
when configured in fields.yml. This reverses the logic and sets mappings to
text only when requested in fields.yml.

The goal is to make upgrading the mapping template less painful. In the Beats
we have so far, unexpected fields are better of as keywords.

@tsg tsg added in progress Pull request is currently in progress. review needs_backport PR is waiting to be backported to other branches. needs tests labels Oct 5, 2016
@tsg
Copy link
Contributor Author

tsg commented Oct 5, 2016

I tested the change with ES 5.0, I'm the process of testing with ES 2.4.

@@ -11,14 +11,13 @@
},
"dynamic_templates": [
{
"fields": {
Copy link
Member

Choose a reason for hiding this comment

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

Nice that you gave it a name. Makes it much more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it used to be the name of the dict/list field name. Now if everything is a keyword by default, the template also gets shorter, because we don't have dicts or lists of type text.

@monicasarbu
Copy link
Contributor

LGTM. This is a great addition to the #2627, in order to have a better upgrading support.

@tsg
Copy link
Contributor Author

tsg commented Oct 5, 2016

Tested with ES 2.4, seems to be working OK.

This adds a dynamic mapping to all our template files to set strings to be
keywords by default.

Previously we were using the default of `text` and only switching to `keyword`
when configured in `fields.yml`. This reverses the logic and sets mappings to
`text` only when requested in `fields.yml`.

The goal is to make upgrading the mapping template less painful. In the Beats
we have so far, unexpected fields are better of as keywords.
@tsg tsg force-pushed the set_strings_as_keywords_by_default branch from 1fa4698 to f414869 Compare October 5, 2016 12:11
@tsg tsg removed in progress Pull request is currently in progress. needs tests labels Oct 5, 2016
@tsg
Copy link
Contributor Author

tsg commented Oct 5, 2016

Added a Changelog entry. This could go in when green from my point of view.

@ruflin ruflin merged commit 714d6eb into elastic:master Oct 5, 2016
tsg added a commit to tsg/beats that referenced this pull request Oct 5, 2016
This adds a dynamic mapping to all our template files to set strings to be
keywords by default.

Previously we were using the default of `text` and only switching to `keyword`
when configured in `fields.yml`. This reverses the logic and sets mappings to
`text` only when requested in `fields.yml`.

The goal is to make upgrading the mapping template less painful. In the Beats
we have so far, unexpected fields are better of as keywords.
andrewkroh added a commit that referenced this pull request Oct 5, 2016
Backport: Set strings to be keywords by default (#2688)
@tsg tsg removed the needs_backport PR is waiting to be backported to other branches. label Oct 10, 2016
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
This adds a dynamic mapping to all our template files to set strings to be
keywords by default.

Previously we were using the default of `text` and only switching to `keyword`
when configured in `fields.yml`. This reverses the logic and sets mappings to
`text` only when requested in `fields.yml`.

The goal is to make upgrading the mapping template less painful. In the Beats
we have so far, unexpected fields are better of as keywords.
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
Backport: Set strings to be keywords by default (elastic#2688)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants