Skip to content

Commit

Permalink
test commit
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Jain <[email protected]>
  • Loading branch information
vibrantvarun committed Jan 14, 2025
1 parent 6dff1a2 commit ecedf35
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ protected void doXContent(XContentBuilder builder, Params params) throws IOExcep
queryBuilder.toXContent(builder, params);
}
builder.endArray();
builder.field(
PAGINATION_DEPTH_FIELD.getPreferredName(),
(paginationDepth == null || paginationDepth == 0) ? DEFAULT_PAGINATION_DEPTH : paginationDepth
);
if (isClusterOnOrAfterMinReqVersionForPaginationInHybridQuery()) {
builder.field(
PAGINATION_DEPTH_FIELD.getPreferredName(),
(paginationDepth == null || paginationDepth == 0) ? DEFAULT_PAGINATION_DEPTH : paginationDepth
);
}
printBoostAndQueryName(builder);
builder.endObject();
}
Expand Down Expand Up @@ -237,7 +239,9 @@ public static HybridQueryBuilder fromXContent(XContentParser parser) throws IOEx
HybridQueryBuilder compoundQueryBuilder = new HybridQueryBuilder();
compoundQueryBuilder.queryName(queryName);
compoundQueryBuilder.boost(boost);
compoundQueryBuilder.paginationDepth(paginationDepth);
if (isClusterOnOrAfterMinReqVersionForPaginationInHybridQuery()) {
compoundQueryBuilder.paginationDepth(paginationDepth);
}
for (QueryBuilder query : queries) {
compoundQueryBuilder.add(query);
}
Expand Down

0 comments on commit ecedf35

Please sign in to comment.