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 _routing field in SearchHit interface #516

Conversation

tushar2404
Copy link
Contributor

@tushar2404 tushar2404 commented Apr 6, 2024

Description

Added Routing field in SearchHit interface

premise:

The OpenSearch Search API currently does not return the routing key in its responses. The routing key is a crucial piece of information, especially in cases where the user or the application has specified a custom routing key for a document at the time of its creation. This omission means that any application or user querying documents from OpenSearch will not receive this key as part of the search results.

Issues Resolved

This pull request addresses this gap by adding a Routing field to the SearchHit interface. With this change, the API will now include the routing key in the search results.

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.

Signed-off-by: Tushar <tmonga06@gmail.com>
Copy link

codecov bot commented Apr 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.96%. Comparing base (06a6dc8) to head (445f046).
Report is 16 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #516       +/-   ##
===========================================
+ Coverage   57.29%   67.96%   +10.66%     
===========================================
  Files         315      376       +61     
  Lines        9823     8852      -971     
===========================================
+ Hits         5628     6016      +388     
+ Misses       2902     1555     -1347     
+ Partials     1293     1281       -12     
Flag Coverage Δ
integration 60.38% <ø> (+9.54%) ⬆️
unit 15.26% <ø> (+2.42%) ⬆️

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

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

... and 268 files with indirect coverage changes

Signed-off-by: Tushar <tmonga06@gmail.com>
@Jakob3xD
Copy link
Collaborator

Jakob3xD commented Apr 7, 2024

Thanks for the PR.
Please add a test for this field.

Signed-off-by: Tushar <tmonga06@gmail.com>
@tushar2404 tushar2404 force-pushed the add-routing-key-in-search-hit-interface branch 2 times, most recently from 84aeb45 to ab6e69f Compare April 21, 2024 13:24
Signed-off-by: tushar2404 <53367076+tushar2404@users.noreply.github.com>
@tushar2404
Copy link
Contributor Author

Thanks for the PR. Please add a test for this field.

done

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.

LGTM, but is it possible to add your test to TestSearch by just adding the Routing Param to the index request? Or does it collide with the other tests?

CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Tushar <tmonga06@gmail.com>
@tushar2404 tushar2404 requested a review from Jakob3xD April 23, 2024 06:38
@Jakob3xD Jakob3xD merged commit b2d9c64 into opensearch-project:main Apr 23, 2024
54 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.

2 participants