-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Deprecate negative weight
in Function Score Query
#33624
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.
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.
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 ?
return (FB) this; | ||
} | ||
|
||
private Float checkWeight(Float weight) { | ||
if (weight != null && Float.compare(weight, 0) < 0) { | ||
DEPRECATION_LOGGER.deprecated("[weight] cannot be negative for a filtering function"); |
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.
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
.
Pinging @elastic/es-search-aggs |
test this please |
test this please |
Thanks @lipsill ! |
This change issues a deprecation message for negative
weight
in Function Score query.This is a preparationfor Lucene 8 (used in 7.0) where negative scores are forbidden.
Fixes #31927