-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Convert TextFieldMapper to parametrized form #63269
Convert TextFieldMapper to parametrized form #63269
Conversation
Pinging @elastic/es-search (:Search/Mapping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything seems in order. I've not looked as closely as I maybe should - I'm trusting @romseygeek and tests to cover sneaky stuff. The less obvious changes that I saw all make good sense to me.
} | ||
this.positionIncrementGap = positionIncrementGap; | ||
return this; | ||
final TextParams.Analyzers analyzers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this below all the Parameter
so I don't lose it?
//Check "=" sign wasn't in the pair string | ||
if(kv[0].length() == pair.length()) { | ||
//untyped value | ||
value = URLDecoder.decode(kv[0], StandardCharsets.UTF_8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -142,7 +142,7 @@ private static CompletionFieldMapper toType(FieldMapper in) { | |||
m -> toType(m).maxInputLength, Defaults.DEFAULT_MAX_INPUT_LENGTH) | |||
.addDeprecatedName("max_input_len") | |||
.setValidator(Builder::validateInputLength) | |||
.alwaysSerialize(); | |||
.setSerializerCheck((id, ic, v) -> true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if alwaysSerialize
should a shortcut to this new thing - it is easier for me to read the intent of alwaysSerialize
than this lambda.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added alwaysSerialize
and neverSerialize
as shortcuts.
@@ -178,6 +180,11 @@ public T getValue() { | |||
return isSet ? value : defaultValue.get(); | |||
} | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you thinking of removing the old getValue
in a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the plan, yes
return new PrefixConfig(minChars, maxChars); | ||
} | ||
|
||
private static final class FielddataFrequencyFilter implements ToXContent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@elasticmachine update branch |
c443d8b
to
33dde51
Compare
BWC issues with serialization mean that I've had to override |
@elasticmachine update branch |
7aa6e71
to
7734125
Compare
As a result of this, we can remove a chunk of code from TypeParsers as well. Tests for search/index mode analyzers have moved into their own file. This commit also rationalises the serialization checks for parameters into a single SerializerCheck interface that takes the values includeDefaults, isConfigured and the value itself. Relates to elastic#62988
As a result of this, we can remove a chunk of code from TypeParsers as well. Tests for search/index mode analyzers have moved into their own file. This commit also rationalises the serialization checks for parameters into a single SerializerCheck interface that takes the values includeDefaults, isConfigured and the value itself. Relates to #62988
As a result of this, we can remove a chunk of code from
TypeParsers
as well. Testsfor search/index mode analyzers have moved into their own file. This commit also
rationalises the serialization checks for parameters into a single
SerializerCheck
interface that takes the values
includeDefaults
,isConfigured
and the valueitself.
Relates to #62988