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

Add scripts to keyword field mapper #71555

Merged
merged 5 commits into from
Apr 12, 2021

Conversation

romseygeek
Copy link
Contributor

This commit adds script and on_script_error parameters to
keyword field mappers, allowing you to define index-time scripts
for keyword fields.

@romseygeek romseygeek added >feature :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.13.0 labels Apr 12, 2021
@romseygeek romseygeek requested a review from javanna April 12, 2021 12:07
@romseygeek romseygeek self-assigned this Apr 12, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 12, 2021
@elasticmachine
Copy link
Collaborator

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

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

LGTM

super(name);
this.indexAnalyzers = indexAnalyzers;
this.scriptCompiler = scriptCompiler;
this.script.precludesParameters(nullValue);
Copy link
Member

Choose a reason for hiding this comment

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

how about ignore_above and normalizer? Should they be supported when a script is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've included those - they're both things that are applied after a value has been read, as opposed to null_value which is applied instead of a value.

}

public Builder(String name) {
this(name, null);
this(name, null, null);
Copy link
Member

Choose a reason for hiding this comment

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

ehm, I think you'll have to use ScriptCompiler.NONE here

@romseygeek romseygeek merged commit 5e11709 into elastic:master Apr 12, 2021
@romseygeek romseygeek deleted the mapper/keyword-index-script branch April 12, 2021 15:46
romseygeek added a commit that referenced this pull request Apr 12, 2021
This commit adds script and on_script_error parameters to
keyword field mappers, allowing you to define index-time scripts
for keyword fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>feature :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.13.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants