-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 doesn't require a function and can specify a weight #74
Comments
Hi there! Sorry for the delay. I'm currently OOO and will review your PR ASAP. Thanks for working on this. |
I'm currently looking into this. If you have the time, maybe we could figure this out together. I model the Go code after the Java client as I found the documentation misleading or incomplete sometimes (it probably has to). In other words: The Java code is the gold standard for me. Here's the code that implements the Function score feature in Java. Important classes are FunctionScoreQueryBuilder which basically is FunctionScoreQuery in Elastic and ScoreFunctionBuilders which is what you find in search_queries_fsq_score_funcs.go. However, when comparing the Java code with your implementation, I see that in Java the weights are only applied to the score functions whereas in your PR you add them to the BTW: I already have a patch available here (if we agree). So no need to change your PR. It fixes some other issues as well (like the |
Closed this for now. Feel free to open a new issue if this doesn't work for you. Cheers. |
This commit fixes an issue in where the `weight` field is now correctly serialized one level above the score function. Furthermore, we added documentation, the `missing` field for the `FieldValueFactorFunction` and the `MultiValueMode` for all decay functions. Finally, we added some documentation. Closes #85 (see also #74).
As of 1.4, elasticsearch has added a weight parameter to function score functions. Futhermore, function score queries do not require a score function if they have both a filter and a weight.
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html
The text was updated successfully, but these errors were encountered: