Skip to content

Conversation

@lipsill
Copy link
Contributor

@lipsill lipsill commented Sep 12, 2018

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

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.
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.


private Float checkWeight(Float weight) {
if (weight != null && Float.compare(weight, 0) < 0) {
DEPRECATION_LOGGER.deprecated("[weight] cannot be negative for a filtering function");
Copy link
Contributor

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.

@colings86 colings86 added the :Search/Search Search-related issues that do not fall into other categories label Sep 12, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@jimczi jimczi added the v6.5.0 label Sep 13, 2018
@jimczi
Copy link
Contributor

jimczi commented Sep 13, 2018

test this please

@jimczi
Copy link
Contributor

jimczi commented Sep 13, 2018

test this please

@jimczi jimczi merged commit 76799bb into elastic:6.x Sep 14, 2018
@jimczi
Copy link
Contributor

jimczi commented Sep 14, 2018

Thanks @lipsill !

@lipsill lipsill deleted the 6.x_neg_weight_depr branch October 24, 2018 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>deprecation :Search/Search Search-related issues that do not fall into other categories v6.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants