-
Notifications
You must be signed in to change notification settings - Fork 115
Revert "Allow single function in FunctionScoreQuery.functions" #5589
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
Conversation
This reverts commit 9bd939c.
|
Following you can find the validation changes against the target branch for the API.
You can validate this API yourself by using the |
|
To clarify what is going on, there are two ways to use function_score, either with a shortcut (that we don't support): Or with a functions array (that we support): However, those are complex examples; in many YAML tests, we just see this: Which passes validation on the main branch, thanks to the current definition of FunctionScoreQuery. Here are the relevant bits: /**
* @shortcut_property functions
*/
export class FunctionScoreQuery extends QueryBase {
/**
* One or more functions that compute a new score for each document returned by the query.
*/
functions?: FunctionScoreContainer | FunctionScoreContainer[]
}The fact that 1/ we allow FunctionScoreContainer in functions and 2/ shortcut_property is still defined on functions makes all YAML tests about function_score pass, even though it is technically wrong. I think we have two options:
|
Reverts #5576
Turns out this is not supported by Elasticsearch! See elastic/elasticsearch#137421. Sorry.