Skip to content

Deprecate negative weight in Function Score Query#33624

Merged
jimczi merged 4 commits intoelastic:6.xfrom
lipsill:6.x_neg_weight_depr
Sep 14, 2018
Merged

Deprecate negative weight in Function Score Query#33624
jimczi merged 4 commits intoelastic:6.xfrom
lipsill:6.x_neg_weight_depr

Conversation

@lipsill
Copy link
Copy Markdown
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
Copy Markdown
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.

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");
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Pinging @elastic/es-search-aggs

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

jimczi commented Sep 13, 2018

test this please

@jimczi
Copy link
Copy Markdown
Contributor

jimczi commented Sep 13, 2018

test this please

@jimczi jimczi merged commit 76799bb into elastic:6.x Sep 14, 2018
@jimczi
Copy link
Copy Markdown
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