-
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
Emit deprecation warnings when boosts are defined in mappings #62623
Conversation
Pinging @elastic/es-search (:Search/Mapping) |
The next step will be to throw an error on indexes created in 8x, and remove MappingFieldType#boost entirely. |
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 it's possible to warn only when the field or index is created ? Not really an issue but that could avoid duplicate log messages every time there is an update on the mapping ? Maybe that's a feature though and having lots of deprecation messages is a good thing.
Anyway, if the plan is to remove this option entirely in 8, +100 to deprecate again in 7x in order to raise the awareness again. Maybe also add a note in the deprecation page, it's already there in 5x but the new plan is to remove in 8 so there should be some warnings in the release notes as well ?
@@ -570,6 +570,9 @@ public final void parse(String name, ParserContext parserContext, Map<String, Ob | |||
throw new MapperParsingException("unknown parameter [" + propName | |||
+ "] on mapper [" + name + "] of type [" + type + "]"); | |||
} | |||
if (Objects.equals("boost", propName)) { | |||
deprecationLogger.deprecate("boost", "Parameter [boost] on field [{}] is deprecated", name); |
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.
maybe add that it will be removed in 8 since that's the new plan ?
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've added version information to the deprecation warning messages.
I've added a note to the |
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.
LGTM
We removed index-time boosting back in 5x, and we no longer document the 'boost' parameter on any of our mapping types. However, it is still possible to define an index-time boost on a field mapper for a surprisingly large number of field types, and they even have an effect (sometimes, on some queries). As a first step in finally removing all traces of index time boosting, this comment emits a deprecation warning whenever a boost parameter is found on a mapping definition.
Follow up to #62623, this commit removes support in 8x for index-time boosts. There is no longer a boost field on MappedFieldType. Indexes created in 8x and after will throw exceptions if a boost parameter is included in mappings, and indexes created in 7x will emit warnings.
We removed index-time boosting back in 5x, and we no longer document the 'boost'
parameter on any of our mapping types. However, it is still possible to define an
index-time boost on a field mapper for a surprisingly large number of field types, and
they even have an effect (sometimes, on some queries).
As a first step in finally removing all traces of index time boosting, this comment emits
a deprecation warning whenever a boost parameter is found on a mapping definition.