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

feat: add support for min_score on ScriptScoreQuery #624

Merged
merged 2 commits into from
Apr 30, 2024
Merged

feat: add support for min_score on ScriptScoreQuery #624

merged 2 commits into from
Apr 30, 2024

Conversation

SamuelCox
Copy link
Contributor

@SamuelCox SamuelCox commented Apr 30, 2024

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
Contributor 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
Contributor 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
Contributor Author

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

@dblock
Copy link
Member

dblock commented Apr 30, 2024

@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

CHANGELOG.md Outdated Show resolved Hide resolved
@SamuelCox
Copy link
Contributor 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
Copy link
Member

dblock commented Apr 30, 2024

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.

@Xtansia
Copy link
Collaborator

Xtansia commented Apr 30, 2024

@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
36 checks passed
@Xtansia Xtansia added the backport 1.x Backport to 1.x branch label Apr 30, 2024
@opensearch-trigger-bot
Copy link
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 <[email protected]>
Signed-off-by: Samuel <[email protected]>

* style: remove empty line Signed-off-by: Samuel <[email protected]>

Signed-off-by: Samuel <[email protected]>

---------

Signed-off-by: Samuel Cox <[email protected]>
Signed-off-by: Samuel <[email protected]>
(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 <[email protected]>
Signed-off-by: Samuel <[email protected]>

* style: remove empty line Signed-off-by: Samuel <[email protected]>

Signed-off-by: Samuel <[email protected]>

---------

Signed-off-by: Samuel Cox <[email protected]>
Signed-off-by: Samuel <[email protected]>
(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