-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Switch to Sending a Bad Request User When Function Score Query Generates Negative Scores #133357
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
Switch to Sending a Bad Request User When Function Score Query Generates Negative Scores #133357
Conversation
…on score query logic generates bad scores
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
|
Hi @john-wagster, I've created a changelog YAML for you. |
|
Keen for opinions here. I was looking at some failures around this and it seemed like IllegalArgumentException made the most sense but not 100% sure. |
…asticsearch into excetpion_funcscorequery
benwtrent
left a comment
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.
Agreed! This should return a bad request.
When the user forms up a function score query that will cause an exception in the scoring logic we should just inform them instead of failing:
For instance for something like:
we return
but should instead throw back an
IllegalArgumentExceptionas it's a user provided error to pass a function that will generate negative scores.Relevant stack: