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 missing SeqNo and PrimaryTerm fields in SearchHit #574

Merged

Conversation

emtammaru
Copy link
Contributor

Description

Adds the missing fields SeqNo and PrimaryTerm to the SearchHit struct. These fields are optionally returned in the response as documented here with the seq_no_primary_term param: https://opensearch.org/docs/latest/api-reference/search/

Issues Resolved

N/A

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 Jun 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.96%. Comparing base (06a6dc8) to head (a907e9d).
Report is 40 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #574       +/-   ##
===========================================
+ Coverage   57.29%   67.96%   +10.67%     
===========================================
  Files         315      376       +61     
  Lines        9823     8853      -970     
===========================================
+ Hits         5628     6017      +389     
+ Misses       2902     1555     -1347     
+ Partials     1293     1281       -12     
Flag Coverage Δ
integration 60.41% <ø> (+9.57%) ⬆️
unit 15.28% <ø> (+2.43%) ⬆️

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

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

... and 272 files with indirect coverage changes

@dblock
Copy link
Member

dblock commented Jun 27, 2024

Thanks! This needs a rebase.

The proposal in #284 might be of interest. Also appreciate if you could take this opportunity to check https://github.com/opensearch-project/opensearch-api-specification for these fields and maybe add a test there.

dblock
dblock previously approved these changes Jun 27, 2024
@emtammaru
Copy link
Contributor Author

Thanks! This needs a rebase.

The proposal in #284 might be of interest. Also appreciate if you could take this opportunity to check https://github.com/opensearch-project/opensearch-api-specification for these fields and maybe add a test there.

Thank you, I checked the spec and I see the fields under response for https://opensearch-project.github.io/opensearch-api-specification/#/default/search.0. Could you point me to where I could add a test for it in https://github.com/opensearch-project/opensearch-api-specification?

@dblock
Copy link
Member

dblock commented Jun 27, 2024

I think https://github.com/opensearch-project/opensearch-api-specification/blob/73d552477f8f006f5ff49f451494d150b8378b18/tests/_core/search.yaml would be a logical place. As long as these are mentioned somewhere.

Erik Tammaru added 2 commits July 1, 2024 12:17
Signed-off-by: Erik Tammaru <[email protected]>
@Jakob3xD Jakob3xD merged commit 2464386 into opensearch-project:main Jul 1, 2024
55 checks passed
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