-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Synthetic source: avoid storing multi fields of type text and match_only_text by default. #129126
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
Changes from 5 commits
6ae7049
a311d59
0d6ea72
f854a8c
ae04e66
4c8047c
5087478
a98f040
281749c
ae4de6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| pr: 129126 | ||
| summary: "Synthetic source: avoid storing multi fields of type text and `match_only_text`\ | ||
| \ by default" | ||
| area: Mapping | ||
| type: bug | ||
| issues: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,11 +83,11 @@ public abstract class FieldMapper extends Mapper { | |
| static final Parameter<?>[] EMPTY_PARAMETERS = new Parameter[0]; | ||
|
|
||
| /** | ||
| * @param multiFields sub fields of this mapper | ||
| * @param copyTo copyTo fields of this mapper | ||
| * @param sourceKeepMode mode for storing the field source in synthetic source mode | ||
| * @param hasScript whether a script is defined for the field | ||
| * @param onScriptError the behaviour for when the defined script fails at runtime | ||
| * @param multiFields sub fields of this mapper | ||
| * @param copyTo copyTo fields of this mapper | ||
| * @param sourceKeepMode mode for storing the field source in synthetic source mode | ||
| * @param hasScript whether a script is defined for the field | ||
| * @param onScriptError the behaviour for when the defined script fails at runtime | ||
| */ | ||
jimczi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| protected record BuilderParams( | ||
| MultiFields multiFields, | ||
|
|
@@ -1384,12 +1384,18 @@ public abstract static class Builder extends Mapper.Builder implements ToXConten | |
| protected Optional<SourceKeepMode> sourceKeepMode = Optional.empty(); | ||
| protected boolean hasScript = false; | ||
| protected OnScriptError onScriptError = null; | ||
| protected final boolean withinMultiField; | ||
|
|
||
| /** | ||
| * Creates a new Builder with a field name | ||
| */ | ||
| protected Builder(String name) { | ||
| this(name, false); | ||
| } | ||
|
|
||
| protected Builder(String name, boolean withinMultiField) { | ||
| super(name); | ||
| this.withinMultiField = withinMultiField; | ||
|
||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1410,7 +1416,7 @@ public Builder addMultiField(FieldMapper.Builder builder) { | |
| return this; | ||
| } | ||
|
|
||
| protected BuilderParams builderParams(Mapper.Builder mainFieldBuilder, MapperBuilderContext context) { | ||
| protected BuilderParams builderParams(FieldMapper.Builder mainFieldBuilder, MapperBuilderContext context) { | ||
| return new BuilderParams(multiFieldsBuilder.build(mainFieldBuilder, context), copyTo, sourceKeepMode, hasScript, onScriptError); | ||
| } | ||
|
|
||
|
|
@@ -1433,6 +1439,10 @@ protected final void validate() { | |
| } | ||
| } | ||
|
|
||
| public boolean isWithinMultiField() { | ||
| return withinMultiField; | ||
| } | ||
|
|
||
| /** | ||
| * @return the list of parameters defined for this mapper | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.