Skip to content
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

Do not pass negative scores into function_score or script_score queries #13627

Closed

Commits on May 24, 2024

  1. Do not pass negative scores into function_score or script_score queries

    In theory, Lucene scores should never go negative. To stop users from
    writing `function_score` and `script_score` queries that return
    negative values, we explicitly check their outputs and throw an
    exception when negative.
    
    Unfortunately, due to a subtle, more complicated bug in multi_match
    queries, sometimes those might (incorrectly) return negative scores.
    
    While that problem is also worth solving, we should protect function
    and script scoring from throwing an exception just for passing through
    a negative value that they had no hand in computing.
    
    Signed-off-by: Michael Froh <froh@amazon.com>
    msfroh committed May 24, 2024
    Configuration menu
    Copy the full SHA
    983e43c View commit details
    Browse the repository at this point in the history