forked from opensearch-project/neural-search
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block top docs collector for hybrid query
Signed-off-by: Martin Gaievski <[email protected]>
- Loading branch information
1 parent
82d9432
commit 0c0a733
Showing
2 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...ava/org/opensearch/neuralsearch/search/query/NoDocCollectorDefaultQueryPhaseSearcher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.opensearch.neuralsearch.search.query; | ||
|
||
import org.apache.lucene.search.Query; | ||
import org.opensearch.search.internal.ContextIndexSearcher; | ||
import org.opensearch.search.internal.SearchContext; | ||
import org.opensearch.search.query.QueryCollectorContext; | ||
import org.opensearch.search.query.QueryPhase; | ||
|
||
import java.io.IOException; | ||
import java.util.LinkedList; | ||
|
||
public class NoDocCollectorDefaultQueryPhaseSearcher extends QueryPhase.DefaultQueryPhaseSearcher { | ||
|
||
@Override | ||
protected boolean searchWithCollector( | ||
SearchContext searchContext, | ||
ContextIndexSearcher searcher, | ||
Query query, | ||
LinkedList<QueryCollectorContext> collectors, | ||
boolean hasFilterCollector, | ||
boolean hasTimeout | ||
) throws IOException { | ||
return super.searchWithCollector(searchContext, searcher, query, collectors, null, hasFilterCollector, hasTimeout, false); | ||
} | ||
} |