-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor implementations of query phase searcher, add empty QueryCollectorContext #13481
Refactor implementations of query phase searcher, add empty QueryCollectorContext #13481
Conversation
6c522fa
to
e290171
Compare
❌ Gradle check result for 6c522fa: 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? |
this change need to be backported to 2.x, need help from maintainers, I don't have permissions to add a label for backport |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13481 +/- ##
============================================
+ Coverage 71.42% 71.55% +0.13%
- Complexity 59978 61008 +1030
============================================
Files 4985 5050 +65
Lines 282275 286815 +4540
Branches 40946 41554 +608
============================================
+ Hits 201603 205220 +3617
- Misses 63999 64647 +648
- Partials 16673 16948 +275 ☔ View full report in Codecov by Sentry. |
server/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/opensearch/search/query/ConcurrentQueryPhaseSearcher.java
Outdated
Show resolved
Hide resolved
d694e2d
to
4381743
Compare
❌ Gradle check result for 4381743: 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? |
❌ Gradle check result for 8744c3e: 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? |
8744c3e
to
af14d56
Compare
❕ Gradle check result for af14d56: 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. |
❌ Gradle check result for 837c4a0: 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? |
@reta can you please help with merging this PR, Jay has approved the PR |
@martin-gaievski could you please rebase? thank you! |
… searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Signed-off-by: Martin Gaievski <gaievski@amazon.com>
837c4a0
to
d13f4a2
Compare
…ectorContext (#13481) * Refactor implementations of query hpase searcher by adding overloaded searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Switched to Empty context add rescoring interface Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Changed if by simple null check for querycontext argument Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Added Override annotation for searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Remove old override method from Concurrent Query Phase Searcher Signed-off-by: Martin Gaievski <gaievski@amazon.com> --------- Signed-off-by: Martin Gaievski <gaievski@amazon.com> (cherry picked from commit 5ff50a7) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ectorContext (#13481) (#13512) * Refactor implementations of query hpase searcher by adding overloaded searchWith method * Switched to Empty context add rescoring interface * Changed if by simple null check for querycontext argument * Added Override annotation for searchWith method * Remove old override method from Concurrent Query Phase Searcher --------- (cherry picked from commit 5ff50a7) Signed-off-by: Martin Gaievski <gaievski@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ectorContext (opensearch-project#13481) * Refactor implementations of query hpase searcher by adding overloaded searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Switched to Empty context add rescoring interface Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Changed if by simple null check for querycontext argument Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Added Override annotation for searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Remove old override method from Concurrent Query Phase Searcher Signed-off-by: Martin Gaievski <gaievski@amazon.com> --------- Signed-off-by: Martin Gaievski <gaievski@amazon.com>
…ectorContext (opensearch-project#13481) * Refactor implementations of query hpase searcher by adding overloaded searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Switched to Empty context add rescoring interface Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Changed if by simple null check for querycontext argument Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Added Override annotation for searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Remove old override method from Concurrent Query Phase Searcher Signed-off-by: Martin Gaievski <gaievski@amazon.com> --------- Signed-off-by: Martin Gaievski <gaievski@amazon.com>
…ectorContext (opensearch-project#13481) * Refactor implementations of query hpase searcher by adding overloaded searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Switched to Empty context add rescoring interface Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Changed if by simple null check for querycontext argument Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Added Override annotation for searchWith method Signed-off-by: Martin Gaievski <gaievski@amazon.com> * Remove old override method from Concurrent Query Phase Searcher Signed-off-by: Martin Gaievski <gaievski@amazon.com> --------- Signed-off-by: Martin Gaievski <gaievski@amazon.com>
Description
Current implementations of query phase searcher (default and concurrent) alway adds
TopDocsCollector
collector to the collector context. In some scenario it's not the preferred behavior, for instance if in a plugin we're adding custom collector that collects doc scores in a different fashion. With current implementation there will be two collectors in the context, this will create a performance overhead.With this change we're not changing core functionality or implementation of query phase searcher. Instead we're adding overloaded
searchWith
method that child query phase search can override and pass emptyQueryPhaseSearcher
.Related Issues
#13170
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.