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

Removed required index for Hit.java (#838) #838

Merged

Conversation

jvan1997
Copy link
Contributor

@jvan1997 jvan1997 commented Feb 7, 2024

For InnerHits, since the index and id is assumed to be the same as parent, they were not included in the InnerHit object, but when converting it into a Hit object in the java sdk, it would throw an exception, saying index is required. Removed it, and also added unit tests.

Signed-off-by: jvan1997 32347479+jvan1997@users.noreply.github.com
(cherry picked from commit c18adb9)

Description

Describe what this change achieves.

Issues Resolved

List any issues this PR will resolve, e.g. Closes [...].
Closes #825
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.

For InnerHits, since the index and id is assumed to be the same as parent, they were not included in the InnerHit object, but when converting it into a Hit object in the java sdk, it would throw an exception, saying index is required. Removed it, and also added unit tests.

Signed-off-by: jvan1997 <32347479+jvan1997@users.noreply.github.com>
(cherry picked from commit c18adb9)
@dblock
Copy link
Member

dblock commented Feb 7, 2024

I saw some comments on another PR from @Sunhick, do those make sense? #831 (review)

@dblock dblock merged commit 1d3cd66 into opensearch-project:2.x Feb 7, 2024
45 checks passed
@jvan1997
Copy link
Contributor Author

jvan1997 commented Feb 7, 2024

I think that's a valid case, I think the issue may stem from using the Hit.java for both the InnerHit (which does not have the index nor id), and also for the Hit itself.

Do we potentially want to create a different class for the InnerHit entirely, or set a flag to indicate that the Hit is an InnerHit?

@dblock
Copy link
Member

dblock commented Feb 7, 2024

Do we potentially want to create a different class for the InnerHit entirely, or set a flag to indicate that the Hit is an InnerHit?

I think it should be two different classes. If they share functionality it should be a base class.

@jvan1997 jvan1997 changed the title Removed required index for Hit.java (#833) Removed required index for Hit.java (#838) Feb 8, 2024
@jvan1997 jvan1997 mentioned this pull request Feb 8, 2024
@BrendonFaleiro BrendonFaleiro mentioned this pull request Jun 21, 2024
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