diff --git a/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java index f5e585f0f1f57..65e60d76f253c 100644 --- a/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/TermsQueryBuilder.java @@ -258,7 +258,7 @@ public TermsQueryBuilder(StreamInput in) throws IOException { termsLookup = in.readOptionalWriteable(TermsLookup::new); values = (List) in.readGenericValue(); this.supplier = null; - if (in.getVersion().after(Version.V_3_0_0)) { + if (in.getVersion().onOrAfter(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } if (in.getVersion().onOrAfter(Version.V_2_17_0)) { @@ -274,7 +274,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(fieldName); out.writeOptionalWriteable(termsLookup); out.writeGenericValue(values); - if (out.getVersion().after(Version.V_3_0_0)) { + if (out.getVersion().onOrAfter(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } if (out.getVersion().onOrAfter(Version.V_2_17_0)) {