Skip to content

Conversation

@owaiskazi19
Copy link
Member

Description

Adds getter for searchContext in FetchContext. We do have other getters for query, filters from searchContext in FetchContext but no getter for searchContext itself.

Related Issues

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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: Owais <owaiskazi19@gmail.com>
@owaiskazi19 owaiskazi19 changed the title Adds getter for searchContext in FetchContext Adds a getter for searchContext in FetchContext Aug 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2025

❌ Gradle check result for e2992b0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2025

❌ Gradle check result for e2992b0: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@msfroh
Copy link
Contributor

msfroh commented Aug 7, 2025

@owaiskazi19, What do you need from SearchContext that you're not already getting?

It looks like FetchContext was specifically designed to provide read-only access to specific fields from SearchContext. I'm concerned that if FetchContext starts to expose the whole SearchContext, then that includes all of the setters, so it's no longer an immutable view.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2025

❕ Gradle check result for e2992b0: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@codecov
Copy link

codecov bot commented Aug 7, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.86%. Comparing base (c01ff89) to head (e2992b0).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...java/org/opensearch/search/fetch/FetchContext.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18951      +/-   ##
============================================
- Coverage     72.89%   72.86%   -0.03%     
+ Complexity    69318    69285      -33     
============================================
  Files          5642     5642              
  Lines        318636   318637       +1     
  Branches      46107    46107              
============================================
- Hits         232254   232172      -82     
- Misses        67540    67659     +119     
+ Partials      18842    18806      -36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +111 to +117
/**
* The search context of the request
*/
public SearchContext searchContext() {
return searchContext;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Copying this comment to code so that it needs to be resolved:

@owaiskazi19, What do you need from SearchContext that you're not already getting?

It looks like FetchContext was specifically designed to provide read-only access to specific fields from SearchContext. I'm concerned that if FetchContext starts to expose the whole SearchContext, then that includes all of the setters, so it's no longer an immutable view.

Copy link
Member Author

Choose a reason for hiding this comment

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

@msfroh figured out a way to handle this in the neural search side without exposing searchcontext in FetchContext. Will close this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants