Skip to content

Commit

Permalink
Sending empty hybrid query context
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Jain <[email protected]>
  • Loading branch information
vibrantvarun committed Jan 13, 2025
1 parent eed678f commit e6aed14
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ protected Query doToQuery(QueryShardContext queryShardContext) throws IOExceptio
if (queryCollection.isEmpty()) {
return Queries.newMatchNoDocsQuery(String.format(Locale.ROOT, "no clauses for %s query", NAME));
}
validatePaginationDepth(paginationDepth, queryShardContext);
HybridQueryContext hybridQueryContext = HybridQueryContext.builder().paginationDepth(paginationDepth).build();
return new HybridQuery(queryCollection, hybridQueryContext);
if (isClusterOnOrAfterMinReqVersionForPaginationInHybridQuery()) {
validatePaginationDepth(paginationDepth, queryShardContext);
HybridQueryContext hybridQueryContext = HybridQueryContext.builder().paginationDepth(paginationDepth).build();
return new HybridQuery(queryCollection, hybridQueryContext);
}
return new HybridQuery(queryCollection, null);
}

/**
Expand Down

0 comments on commit e6aed14

Please sign in to comment.