Skip to content

Commit

Permalink
fix backwards incompatible io stream
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 6881e10 commit 1c58949
Showing 1 changed file with 4 additions and 4 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 = false;

private Integer trackTotalHitsUpTo;

Expand Down Expand Up @@ -262,7 +262,7 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
terminateAfter = in.readVInt();
timeout = in.readOptionalTimeValue();
trackScores = in.readBoolean();
includeNamedQueriesScore = in.readBoolean();
includeNamedQueriesScore = in.readOptionalBoolean();
version = in.readOptionalBoolean();
seqNoAndPrimaryTerm = in.readOptionalBoolean();
extBuilders = in.readNamedWriteableList(SearchExtBuilder.class);
Expand Down Expand Up @@ -326,7 +326,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(terminateAfter);
out.writeOptionalTimeValue(timeout);
out.writeBoolean(trackScores);
out.writeBoolean(includeNamedQueriesScore);
out.writeOptionalBoolean(includeNamedQueriesScore);
out.writeOptionalBoolean(version);
out.writeOptionalBoolean(seqNoAndPrimaryTerm);
out.writeNamedWriteableList(extBuilders);
Expand Down Expand Up @@ -586,7 +586,7 @@ public SearchSourceBuilder includeNamedQueriesScores(boolean includeNamedQueries
* Indicates whether scores will be returned as part of every search matched query.s
*/
public boolean includeNamedQueriesScore() {
return includeNamedQueriesScore;
return includeNamedQueriesScore != null && includeNamedQueriesScore;
}

/**
Expand Down

0 comments on commit 1c58949

Please sign in to comment.