-
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
Forbid negative scores in function_score query #35709
Forbid negative scores in function_score query #35709
Conversation
- Throw an exception when scores are negative in field_value_factor function - Throw an exception when scores are negative in script_score function Relates to elastic#33309
Pinging @elastic/es-search-aggs |
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.
LGTM. I wonder if we also need to check the finalScore
computed by FunctionScoreQuery#FunctionFactorScorer#scorer
? It should not be possible to produce a negative score with the current checks but I could have missed something.
query: | ||
term: | ||
test: value | ||
"functions": [{ |
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.
nit: indent
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.
Can you also add a note in the breaking changes ?
This this only be made in 7.0, not 6.6? Maybe a deprecation warning in 6.6 instead? |
d55bf1e
to
35ebc96
Compare
@elasticmachine test this please |
* Forbid negative scores in functon_score query - Throw an exception when scores are negative in field_value_factor function - Throw an exception when scores are negative in script_score function Relates to #33309
function
function
Relates to #33309