Skip to content

Commit

Permalink
Replace the right version to fix backward compatibility introduced wi…
Browse files Browse the repository at this point in the history
…th DerivedFields feature (#13168)

Signed-off-by: Rishabh Maurya <[email protected]>
  • Loading branch information
rishabhmaurya authored Apr 11, 2024
1 parent 52ce070 commit 02e3c56
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
if (in.getVersion().onOrAfter(Version.V_2_13_0)) {
includeNamedQueriesScore = in.readOptionalBoolean();
}
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_14_0)) {
if (in.readBoolean()) {
derivedFieldsObject = in.readMap();
}
Expand Down Expand Up @@ -365,7 +365,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(Version.V_2_13_0)) {
out.writeOptionalBoolean(includeNamedQueriesScore);
}
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_14_0)) {
boolean hasDerivedFieldsObject = derivedFieldsObject != null;
out.writeBoolean(hasDerivedFieldsObject);
if (hasDerivedFieldsObject) {
Expand Down

0 comments on commit 02e3c56

Please sign in to comment.