Skip to content

feat: add support for min_score on ScriptScoreQuery#624

Merged
Xtansia merged 2 commits into
opensearch-project:mainfrom
SamuelCox:main
Apr 30, 2024
Merged

feat: add support for min_score on ScriptScoreQuery#624
Xtansia merged 2 commits into
opensearch-project:mainfrom
SamuelCox:main

Conversation

@SamuelCox

@SamuelCox SamuelCox commented Apr 30, 2024

Copy link
Copy Markdown
Collaborator

Description

Add support for min_score property in ScriptScoreQuery. This also is a proper version of #623 which I closed after realising trying to add something to an SDK in the github browser editor was probably a bad idea.

Also, when running build.bat locally I get a few errors, I don't want to take the action minutes up with another duff run, so could someone check if this is just something not correctly set up on my machine, or an actual error I've caused?
image
image
I could be missing it, but I couldn't find a guide on how to run these tests so I'm assuming I'm missing some setup

Issues Resolved

Closes #622

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.

@SamuelCox

Copy link
Copy Markdown
Collaborator Author

I can mark this as ready for review if the maintainers are happy, I just thought I should wait to figure out why those tests are failing first.

@SamuelCox SamuelCox marked this pull request as ready for review April 30, 2024 15:46
@SamuelCox

Copy link
Copy Markdown
Collaborator Author

Have marked as ready for review so it gets in front of maintainers, but like I say I'm not sure what's causing those test failures on my local machine

@SamuelCox

Copy link
Copy Markdown
Collaborator Author

image
Seems like those NullRefs are gone after trying a couple more times, so I guess they were just flaky.

@dblock

dblock commented Apr 30, 2024

Copy link
Copy Markdown
Member

@tfarrep where does this fall in the code generation?

@SamuelCox check whether this field exists in https://github.com/opensearch-project/opensearch-api-specification, please and contribute there if it's not, we're trying to get most code generated from spec

@SamuelCox on the errors, I think we need a developer guide like https://github.com/opensearch-project/opensearch-py/blob/main/DEVELOPER_GUIDE.md (want to start one?) and we can debug what's going on with your own setup

Comment thread CHANGELOG.md Outdated
@SamuelCox

Copy link
Copy Markdown
Collaborator Author

@tfarrep where does this fall in the code generation?

@SamuelCox check whether this field exists in https://github.com/opensearch-project/opensearch-api-specification, please and contribute there if it's not, we're trying to get most code generated from spec

@SamuelCox on the errors, I think we need a developer guide like https://github.com/opensearch-project/opensearch-py/blob/main/DEVELOPER_GUIDE.md (want to start one?) and we can debug what's going on with your own setup

image
It appears to exist in the spec already if I understand correctly. @Xtansia asked me to add it here in the issue I logged but perhaps I misunderstood.

I agree that a dev guide would be good, probably would be best to add as a separate PR though?

Happy to add a follow up when I get time

@dblock

dblock commented Apr 30, 2024

Copy link
Copy Markdown
Member

It appears to exist in the spec already if I understand correctly. @Xtansia asked me to add it here in the issue I logged but perhaps I misunderstood.

Good. Then ignore me.

I agree that a dev guide would be good, probably would be best to add as a separate PR though?
Happy to add a follow up when I get time

Yes, and thank you in advance.

Signed-off-by: Samuel Cox <sam.r.c@hotmail.com>
Signed-off-by: Samuel <sam.r.c@hotmail.com>
@Xtansia

Xtansia commented Apr 30, 2024

Copy link
Copy Markdown
Collaborator

@dblock This is a field in the request body and the generator does not yet generate the request/response body structures.

@SamuelCox Thanks for PR'ing this so quickly, changes look good to me, just waiting on the CI to pass. Unfortunately there is a couple flaky tests floating around, I've made an issue regarding your specific null ref one (#626). The TestEphemeralCluster 403 errors are ones I haven't experienced myself (nor seen in CI), but were also reported in #282. So if you happen to gain any further insight please add it to the relevant issues. I also second that if you wanted to contribute towards a developer's guide that'd be amazing!

@Xtansia Xtansia merged commit 8d89519 into opensearch-project:main Apr 30, 2024
@Xtansia Xtansia added the backport 1.x Backport to 1.x branch label Apr 30, 2024
@opensearch-trigger-bot

Copy link
Copy Markdown
Contributor

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-624-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8d8951957e613612b30cc2949e822b4b63cc7c5a
# Push it to GitHub
git push --set-upstream origin backport/backport-624-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-624-to-1.x.

Xtansia pushed a commit to Xtansia/opensearch-net that referenced this pull request Apr 30, 2024
…ct#624)

* feat: add support for min_score on ScriptScoreQuery

Signed-off-by: Samuel Cox <sam.r.c@hotmail.com>
Signed-off-by: Samuel <sam.r.c@hotmail.com>

* style: remove empty line Signed-off-by: Samuel <sam.r.c@hotmail.com>

Signed-off-by: Samuel <sam.r.c@hotmail.com>

---------

Signed-off-by: Samuel Cox <sam.r.c@hotmail.com>
Signed-off-by: Samuel <sam.r.c@hotmail.com>
(cherry picked from commit 8d89519)
dblock pushed a commit that referenced this pull request May 1, 2024
* feat: add support for min_score on ScriptScoreQuery

Signed-off-by: Samuel Cox <sam.r.c@hotmail.com>
Signed-off-by: Samuel <sam.r.c@hotmail.com>

* style: remove empty line Signed-off-by: Samuel <sam.r.c@hotmail.com>

Signed-off-by: Samuel <sam.r.c@hotmail.com>

---------

Signed-off-by: Samuel Cox <sam.r.c@hotmail.com>
Signed-off-by: Samuel <sam.r.c@hotmail.com>
(cherry picked from commit 8d89519)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 1.x Backport to 1.x branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] No MinScore property exposed on ScriptScore query

3 participants