From 9e12de8578fdcd2cf6cb2949f6594acaecf87591 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 12:49:30 -0700 Subject: [PATCH] Made hybrid QPS extending QueryPhaseSearcherWrapper (#356) (#364) Signed-off-by: Martin Gaievski (cherry picked from commit 2c5d150262a059b4647ac09ced8c8fe3f3af76d7) Co-authored-by: Martin Gaievski --- CHANGELOG.md | 1 + .../search/query/HybridQueryPhaseSearcher.java | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da2ae9ec9..6f448684a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,4 +20,5 @@ Support sparse semantic retrieval by introducing `sparse_encoding` ingest proces ### Infrastructure ### Documentation ### Maintenance +Consumed latest changes from core, use QueryPhaseSearcherWrapper as parent class for Hybrid QPS ([#356](https://github.com/opensearch-project/neural-search/pull/356)) ### Refactoring diff --git a/src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java b/src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java index abf1b8813..f65e30222 100644 --- a/src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java +++ b/src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java @@ -33,6 +33,7 @@ import org.opensearch.search.internal.SearchContext; import org.opensearch.search.query.QueryCollectorContext; import org.opensearch.search.query.QueryPhase; +import org.opensearch.search.query.QueryPhaseSearcherWrapper; import org.opensearch.search.query.QuerySearchResult; import org.opensearch.search.query.TopDocsCollectorContext; import org.opensearch.search.rescore.RescoreContext; @@ -45,7 +46,11 @@ * upstream standard implementation of searcher is called. */ @Log4j2 -public class HybridQueryPhaseSearcher extends QueryPhase.DefaultQueryPhaseSearcher { +public class HybridQueryPhaseSearcher extends QueryPhaseSearcherWrapper { + + public HybridQueryPhaseSearcher() { + super(); + } public boolean searchWith( final SearchContext searchContext, @@ -58,7 +63,7 @@ public boolean searchWith( if (query instanceof HybridQuery) { return searchWithCollector(searchContext, searcher, query, collectors, hasFilterCollector, hasTimeout); } - return super.searchWithCollector(searchContext, searcher, query, collectors, hasFilterCollector, hasTimeout); + return super.searchWith(searchContext, searcher, query, collectors, hasFilterCollector, hasTimeout); } @VisibleForTesting