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

Support optional function score variant #880

Merged

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Feb 26, 2024

Description

This PR supports function score functions with an optional function variant. The function is optional as it is perfectly valid to have a function with only a weight e.g. a function score query with multiple functions and a score mode of "first", where the last weight function acts as some default value.

#786 also addresses this issue but contains quite a few other unrelated changes e.g. DelegatingJsonpMapper.

Issues Resolved

Closes #820
Closes #752

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

This commit supports function score functions with an
optional function variant. The function is optional as it
is perfectly valid to have a function with only a weight e.g.
a function score query with multiple functions and a score mode
of "first", where the last weight function acts as some default value.

Closes opensearch-project#820

Signed-off-by: Russ Cam <russcam@canva.com>
Signed-off-by: Russ Cam <russcam@canva.com>
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Russ Cam <russcam@canva.com>
Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @russcam!

@VachaShah VachaShah merged commit 045c805 into opensearch-project:main Feb 27, 2024
49 checks passed
@VachaShah VachaShah added the backport 2.x Backport to 2.x branch label Feb 27, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 27, 2024
* Support optional function score variant

This commit supports function score functions with an
optional function variant. The function is optional as it
is perfectly valid to have a function with only a weight e.g.
a function score query with multiple functions and a score mode
of "first", where the last weight function acts as some default value.

Closes #820

Signed-off-by: Russ Cam <russcam@canva.com>

* Address CI build issues

Signed-off-by: Russ Cam <russcam@canva.com>

* remove changelog entry for 3.0

Signed-off-by: Russ Cam <russcam@canva.com>

---------

Signed-off-by: Russ Cam <russcam@canva.com>
(cherry picked from commit 045c805)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
VachaShah pushed a commit that referenced this pull request Feb 27, 2024
* Support optional function score variant

This commit supports function score functions with an
optional function variant. The function is optional as it
is perfectly valid to have a function with only a weight e.g.
a function score query with multiple functions and a score mode
of "first", where the last weight function acts as some default value.

Closes #820



* Address CI build issues



* remove changelog entry for 3.0



---------


(cherry picked from commit 045c805)

Signed-off-by: Russ Cam <russcam@canva.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@BrendonFaleiro BrendonFaleiro mentioned this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
3 participants