-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Function score and optional weight : avg score is wrong #8992
Comments
Thanks @ghiron! Do you want to create a pull request with your change? |
I'm on it |
@rjernst : I'm updating tests and have negative weight in some tests. Does it really make sense to have negative weight ? |
@ghiron Which tests use negative weights? |
@rjernst in FunctionScoreTests createRandomWeights method returns negative value half of the time An other comment about this test class : getRandomScoreMode method returns random score mode value but does not guarantee all values will be tested. |
related to #7137 #6955
Score calculation is wrong when score mode is set to average :
Let's say we have :
returned value is (25 *10 +10 * 5 )/ 2 = 150
returned value should be (25 *10 +10 * 5 )/ (10 +5) = 20
I think problem is located in org.elasticsearch.common.lucene.search.function.FiltersFunctionScoreQuery:302
should be something like
The text was updated successfully, but these errors were encountered: