-
Notifications
You must be signed in to change notification settings - Fork 49
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
Fixes #321: fix highlight max_analyzer_offset field name to match OS 2.2.0 #322
Conversation
9ce7ea2
to
d998073
Compare
Can you add a unit and/or integration test please? |
I have extended the existing Highlighting unit test. Have to say, was working a little blindly, since I was not able to get these tests running. |
You have to add a switch or keep both options, because this .Net client should work with all OpenSearch versions.
|
Understood. Do you have a pointer where this already happens in the project so I can implement it consistently? |
I think you need to keep both in the client code, like we have with opensearch-net/src/OpenSearch.Client/Nodes/NodesInfo/NodeRole.cs Lines 37 to 43 in 74bcaab
For integration tests you can duplicate tests and use opensearch-net/tests/Tests/Cat/CatClusterManager/CatClusterManagerApiTests.cs Lines 40 to 42 in 74bcaab
opensearch-net/tests/Tests/Cat/CatMaster/CatMasterApiTests.cs Lines 40 to 42 in 74bcaab
So client will be compatible with all OpenSearch version and test framework will skip test of incompatible feature for given version range. |
… name to match OS 2.2.0 Signed-off-by: Gideon Junge <gjunge@gmail.com>
Signed-off-by: Gideon Junge <gjunge@gmail.com>
Signed-off-by: Gideon Junge <gjunge@gmail.com>
max_analyzer_offset can be set both on highlight in general, and on specific fields. Signed-off-by: Gideon Junge <gjunge@gmail.com>
Added also field level max_analyzer_offset. Gives the new unit test some more "reason to exist". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing this fix @gjunge, looks good!
The backport to
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-322-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 8ad8057696044485d53858b794f2d6d0dc74aa8d
# Push it to GitHub
git push --set-upstream origin backport/backport-322-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 |
… name to match OS 2.2.0 (opensearch-project#322) * Fixes opensearch-project#321: fix highlight max_analyzer_offset field name to match OS 2.2.0 Signed-off-by: Gideon Junge <gjunge@gmail.com> * extend existing highlighting unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Create > 2.2.0 unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Implement HighlightField level max_analyzer_offset max_analyzer_offset can be set both on highlight in general, and on specific fields. Signed-off-by: Gideon Junge <gjunge@gmail.com> --------- Signed-off-by: Gideon Junge <gjunge@gmail.com> (cherry picked from commit 8ad8057)
… name to match OS 2.2.0 (opensearch-project#322) * Fixes opensearch-project#321: fix highlight max_analyzer_offset field name to match OS 2.2.0 Signed-off-by: Gideon Junge <gjunge@gmail.com> * extend existing highlighting unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Create > 2.2.0 unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Implement HighlightField level max_analyzer_offset max_analyzer_offset can be set both on highlight in general, and on specific fields. Signed-off-by: Gideon Junge <gjunge@gmail.com> --------- Signed-off-by: Gideon Junge <gjunge@gmail.com> (cherry picked from commit 8ad8057)
…2.2.0 (#322) (#324) * Fixes #321: fix highlight max_analyzer_offset field name to match OS 2.2.0 Signed-off-by: Gideon Junge <gjunge@gmail.com> * extend existing highlighting unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Create > 2.2.0 unit test Signed-off-by: Gideon Junge <gjunge@gmail.com> * Implement HighlightField level max_analyzer_offset max_analyzer_offset can be set both on highlight in general, and on specific fields. Signed-off-by: Gideon Junge <gjunge@gmail.com> --------- Signed-off-by: Gideon Junge <gjunge@gmail.com> (cherry picked from commit 8ad8057) Co-authored-by: Gideon Junge <gjunge@gmail.com>
Fix field
max_analyzed_offset
tomax_analyzer_offset
Description
The current field
max_analyzed_offset
used in ElasticSearch doesn't match the field added to OpenSearch version 2.2.0,max_analyzer_offset
.This means the current client implementation have two problems:
It doesn't work for versions before version 2.2.0, because no equivalent field exist on OpenSearch.
It doesn't work for version after 2.2.0, because the field is misspelled.
Even though the Property changes, which is normally a breaking change, since the current field is unusable, this change is not "breaking" anything.
For further information see:
Issues Resolved:
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.