Deprecate negative weight in Function Score Query#33624
Merged
jimczi merged 4 commits intoelastic:6.xfrom Sep 14, 2018
Merged
Conversation
This change issues a deprecation message for negative `weight` in Function Score query. This is a preparation for Lucene 8 (used in 7.0) where negative scores are forbidden.
jimczi
requested changes
Sep 12, 2018
Contributor
jimczi
left a comment
There was a problem hiding this comment.
Thanks @lipsill . I left some comments.
Can you also add an entry in https://github.com/elastic/elasticsearch/blob/6.x/docs/reference/migration/migrate_6_0/search.asciidoc#changes-to-queries regarding the deprecation ?
|
|
||
| private Float checkWeight(Float weight) { | ||
| if (weight != null && Float.compare(weight, 0) < 0) { | ||
| DEPRECATION_LOGGER.deprecated("[weight] cannot be negative for a filtering function"); |
Contributor
There was a problem hiding this comment.
s/filtering function/function score query ? I'll fix on master ;)
Also can you put a more descriptive message about the deprecation. Something like Setting a negative weight is deprecated and will throw an error in the next major version.
Collaborator
|
Pinging @elastic/es-search-aggs |
jimczi
approved these changes
Sep 13, 2018
Contributor
|
test this please |
Contributor
|
test this please |
Contributor
|
Thanks @lipsill ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change issues a deprecation message for negative
weightin Function Score query.This is a preparationfor Lucene 8 (used in 7.0) where negative scores are forbidden.
Fixes #31927