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

Add the Explanation field containing the document explain details to SearchHit #504

Merged
merged 4 commits into from
Apr 3, 2024

Conversation

zr-bennettm
Copy link
Contributor

Description

Previously, calling the Search function here with Explain set to true in Params in the SearchReq did not add an explanation payload to each document. This pull request fixes that by adding an Explanation field to the SearchHit struct.

Issues Resolved

This resolves issue 503, which I raised.

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.

Copy link

codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.29%. Comparing base (3b901c7) to head (af5ab5d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #504      +/-   ##
==========================================
+ Coverage   57.26%   57.29%   +0.03%     
==========================================
  Files         315      315              
  Lines        9823     9823              
==========================================
+ Hits         5625     5628       +3     
+ Misses       2904     2902       -2     
+ Partials     1294     1293       -1     
Flag Coverage Δ
integration 50.83% <ø> (+0.03%) ⬆️
unit 12.84% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
opensearchapi/api_search.go 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@Jakob3xD
Copy link
Collaborator

Jakob3xD commented Apr 3, 2024

Thank you for the PR. Looks good so far.
Could you please add a test for this in file opensearchapi/api_search_test.go.

You can run the tests locally by following the steps in the developer guide.

@zr-bennettm
Copy link
Contributor Author

@Jakob3xD just added one

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

@zr-bennettm You will need to sign DCO (git commit -s --amend and force push) for all your commits, please.

@dblock
Copy link
Member

dblock commented Apr 3, 2024

Looks like #506 is fixing CI, rebase after that's merged.

Copy link
Collaborator

@Jakob3xD Jakob3xD left a comment

Choose a reason for hiding this comment

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

Small nit but looks good.

opensearchapi/api_search_test.go Outdated Show resolved Hide resolved
zr-bennettm and others added 4 commits April 3, 2024 10:52
…SearchHit

Signed-off-by: Bennett Mountain <bennettm@ziprecruiter.com>
Signed-off-by: zr-bennettm <165848212+zr-bennettm@users.noreply.github.com>
Signed-off-by: Bennett Mountain <bennettm@ziprecruiter.com>
…inter

Signed-off-by: Bennett Mountain <bennettm@ziprecruiter.com>
@zr-bennettm
Copy link
Contributor Author

@Jakob3xD @dblock just rebased and went with @Jakob3xD 's suggestion

@zr-bennettm zr-bennettm requested review from Jakob3xD and dblock April 3, 2024 17:55
@dblock dblock merged commit 392013b into opensearch-project:main Apr 3, 2024
55 checks passed
@zr-bennettm
Copy link
Contributor Author

@dblock @Jakob3xD just curious, how long should it take to see this be put into effect? I know it's merged in main but the documentation here isn't updated yet. Do we need to wait until V3.2?

@dblock
Copy link
Member

dblock commented Apr 6, 2024

We release often. Open an issue like "Release v.Next", if you need a release quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants