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

Emit deprecation warnings when boosts are defined in mappings #62623

Merged
merged 4 commits into from
Sep 18, 2020

Conversation

romseygeek
Copy link
Contributor

@romseygeek romseygeek commented Sep 18, 2020

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.

@romseygeek romseygeek added :Search Foundations/Mapping Index mappings, including merging and defining field types >deprecation v8.0.0 v7.10.0 labels Sep 18, 2020
@romseygeek romseygeek requested a review from jimczi September 18, 2020 11:57
@romseygeek romseygeek self-assigned this Sep 18, 2020
@elasticmachine
Copy link
Collaborator

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

@elasticmachine elasticmachine added the Team:Search Meta label for search team label Sep 18, 2020
@romseygeek
Copy link
Contributor Author

The next step will be to throw an error on indexes created in 8x, and remove MappingFieldType#boost entirely.

Copy link
Contributor

@jimczi jimczi left a 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);
Copy link
Contributor

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 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

++

@romseygeek
Copy link
Contributor Author

I've added version information to the deprecation warning messages.

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 ?

I've added a note to the migrate_8_0/mappings doc, and I'll move it to the migrate_7_10 doc on backport.

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

LGTM

@romseygeek romseygeek merged commit 2b0418d into elastic:master Sep 18, 2020
@romseygeek romseygeek deleted the mapper/boosts branch September 18, 2020 14:35
@romseygeek romseygeek restored the mapper/boosts branch September 18, 2020 14:41
@romseygeek romseygeek deleted the mapper/boosts branch September 18, 2020 14:41
@romseygeek romseygeek restored the mapper/boosts branch September 18, 2020 14:41
romseygeek added a commit that referenced this pull request Sep 18, 2020
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.
romseygeek added a commit that referenced this pull request Sep 23, 2020
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>deprecation :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.10.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants