opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.85k stars 1.83k forks source link

Add a flag in QueryShardContext to differentiate inner hit query #16600

Closed heemin32 closed 1 week ago

heemin32 commented 2 weeks ago

Description

Add a flag in QueryShardContext to differentiate inner hit query and normal query.

For k-NN nested fields, the query currently searches for the nested field document with the highest score for each parent document, returning only a single nested field document in the inner hit block. We want to modify this query behavior to retrieve all nested field documents in the inner hit block, rather than just the one with the highest score. To implement this, we need to identify whether the current query request is targeting an inner hit block or not.

Alternatives

Related Issues

Resolves https://github.com/opensearch-project/k-NN/issues/2249

Check List

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.

github-actions[bot] commented 2 weeks ago

:x: Gradle check result for 11f798061cb23d3bb50b9156691fb9bda3629e83: 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[bot] commented 2 weeks ago

:white_check_mark: Gradle check result for 7f16389b44de49ce35e4bb87db19a1c381508ef6: SUCCESS

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.04%. Comparing base (e688388) to head (7f16389). Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #16600 +/- ## ============================================ - Coverage 72.15% 72.04% -0.11% + Complexity 65128 65065 -63 ============================================ Files 5315 5315 Lines 303573 303578 +5 Branches 43925 43925 ============================================ - Hits 219036 218707 -329 - Misses 66565 66940 +375 + Partials 17972 17931 -41 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.