Skip to content

Commit

Permalink
Addressing Jacks comments
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Gaievski <[email protected]>
  • Loading branch information
martin-gaievski committed Mar 7, 2024
1 parent 253781c commit 8e5527b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class HybridQueryScorer extends Scorer {
private final Map<Query, List<Integer>> queryToIndex;

private final DocIdSetIterator approximation;
HybridScoreBlockBoundaryPropagator disjunctionBlockPropagator;
private final HybridScoreBlockBoundaryPropagator disjunctionBlockPropagator;
private final TwoPhase twoPhase;

public HybridQueryScorer(Weight weight, List<Scorer> subScorers) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import com.google.common.annotations.VisibleForTesting;
import lombok.AllArgsConstructor;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Collector;
import org.apache.lucene.search.CollectorManager;
import org.apache.lucene.search.FieldExistsQuery;
import org.apache.lucene.search.Query;
Expand Down Expand Up @@ -199,15 +197,16 @@ public void preProcess(SearchContext context) {
} catch (IOException e) {
throw new RuntimeException(e);

Check warning on line 198 in src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/neuralsearch/search/query/HybridQueryPhaseSearcher.java#L197-L198

Added lines #L197 - L198 were not covered by tests
}
Map<Class<?>, CollectorManager<? extends Collector, ReduceableSearchResult>> collectorManagersByManagerClass = context
.queryCollectorManagers();
collectorManagersByManagerClass.put(HybridCollectorManager.class, collectorManager);
context.queryCollectorManagers().put(HybridCollectorManager.class, collectorManager);
}
}

@Override
public void postProcess(SearchContext context) {
if (isHybridQuery(context.query(), context)) {
// for case when concurrent search is not enabled (default as of 2.12 release) reduce for collector
// managers is not called, and we have to call it manually. This is required as we format final
// result of hybrid query in {@link HybridTopScoreCollector#reduce}
if (!context.shouldUseConcurrentSearch()) {
reduceCollectorResults(context);
}
Expand Down

0 comments on commit 8e5527b

Please sign in to comment.