Skip to content

Commit

Permalink
fix backwards compatible tests
Browse files Browse the repository at this point in the history
Signed-off-by: Dharin Shah <8616130+Dharin-shah@users.noreply.github.com>
  • Loading branch information
Dharin-shah committed Feb 2, 2024
1 parent 1c58949 commit 9487a23
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public static HighlightBuilder highlight() {

private boolean trackScores = false;

private Boolean includeNamedQueriesScore = false;
private Boolean includeNamedQueriesScore;

private Integer trackTotalHitsUpTo;

Expand Down Expand Up @@ -262,7 +262,6 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
terminateAfter = in.readVInt();
timeout = in.readOptionalTimeValue();
trackScores = in.readBoolean();
includeNamedQueriesScore = in.readOptionalBoolean();
version = in.readOptionalBoolean();
seqNoAndPrimaryTerm = in.readOptionalBoolean();
extBuilders = in.readNamedWriteableList(SearchExtBuilder.class);
Expand All @@ -280,6 +279,9 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
searchPipelineSource = in.readMap();
}
}
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
includeNamedQueriesScore = in.readOptionalBoolean();
}
}

@Override
Expand Down Expand Up @@ -326,7 +328,6 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(terminateAfter);
out.writeOptionalTimeValue(timeout);
out.writeBoolean(trackScores);
out.writeOptionalBoolean(includeNamedQueriesScore);
out.writeOptionalBoolean(version);
out.writeOptionalBoolean(seqNoAndPrimaryTerm);
out.writeNamedWriteableList(extBuilders);
Expand All @@ -346,6 +347,9 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeMap(searchPipelineSource);
}
}
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeOptionalBoolean(includeNamedQueriesScore);
}
}

/**
Expand Down

0 comments on commit 9487a23

Please sign in to comment.