diff --git a/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java index 3f4d3dd974967..e420784f558c0 100644 --- a/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/FuzzyQueryBuilder.java @@ -186,7 +186,7 @@ public FuzzyQueryBuilder(StreamInput in) throws IOException { maxExpansions = in.readVInt(); transpositions = in.readBoolean(); rewrite = in.readOptionalString(); - if (in.getVersion().onOrAfter(Version.V_2_17_0)) { + if (in.getVersion().onOrAfter(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } } @@ -200,7 +200,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeVInt(this.maxExpansions); out.writeBoolean(this.transpositions); out.writeOptionalString(this.rewrite); - if (out.getVersion().onOrAfter(Version.V_2_17_0)) { + if (out.getVersion().onOrAfter(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } } diff --git a/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java index bfa24ca096f10..668ed0283b21a 100644 --- a/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/PrefixQueryBuilder.java @@ -103,7 +103,7 @@ public PrefixQueryBuilder(StreamInput in) throws IOException { value = in.readString(); rewrite = in.readOptionalString(); caseInsensitive = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_2_17_0)) { + if (in.getVersion().onOrAfter(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } } @@ -114,7 +114,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(value); out.writeOptionalString(rewrite); out.writeBoolean(caseInsensitive); - if (out.getVersion().onOrAfter(Version.V_2_17_0)) { + if (out.getVersion().onOrAfter(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } } diff --git a/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java index 7973c0eef97c5..a631ed351dde6 100644 --- a/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/RangeQueryBuilder.java @@ -122,7 +122,7 @@ public RangeQueryBuilder(StreamInput in) throws IOException { throw new IllegalArgumentException("[range] query does not support relation [" + relationString + "]"); } } - if (in.getVersion().after(Version.V_2_17_0)) { + if (in.getVersion().after(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } } @@ -145,7 +145,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { relationString = this.relation.getRelationName(); } out.writeOptionalString(relationString); - if (out.getVersion().after(Version.V_2_17_0)) { + if (out.getVersion().after(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } } diff --git a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java index 01fe387e00196..726e9477a9347 100644 --- a/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/RegexpQueryBuilder.java @@ -117,7 +117,7 @@ public RegexpQueryBuilder(StreamInput in) throws IOException { maxDeterminizedStates = in.readVInt(); rewrite = in.readOptionalString(); caseInsensitive = in.readBoolean(); - if (in.getVersion().after(Version.V_2_17_0)) { + if (in.getVersion().after(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } } @@ -130,7 +130,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeVInt(maxDeterminizedStates); out.writeOptionalString(rewrite); out.writeBoolean(caseInsensitive); - if (out.getVersion().after(Version.V_2_17_0)) { + if (out.getVersion().after(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } } 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 7e9dc59076d54..6ffd1e43d01ea 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_2_17_0)) { + if (in.getVersion().after(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } if (in.getVersion().onOrAfter(Version.V_3_0_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_2_17_0)) { + if (out.getVersion().after(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } if (out.getVersion().onOrAfter(Version.V_3_0_0)) { diff --git a/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java b/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java index 0b376507b8f13..8369b3d1f1b54 100644 --- a/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java +++ b/server/src/main/java/org/opensearch/index/query/WildcardQueryBuilder.java @@ -113,7 +113,7 @@ public WildcardQueryBuilder(StreamInput in) throws IOException { value = in.readString(); rewrite = in.readOptionalString(); caseInsensitive = in.readBoolean(); - if (in.getVersion().after(Version.V_2_17_0)) { + if (in.getVersion().after(Version.V_3_0_0)) { rewriteOverride = in.readOptionalString(); } } @@ -124,7 +124,7 @@ protected void doWriteTo(StreamOutput out) throws IOException { out.writeString(value); out.writeOptionalString(rewrite); out.writeBoolean(caseInsensitive); - if (out.getVersion().after(Version.V_2_17_0)) { + if (out.getVersion().after(Version.V_3_0_0)) { out.writeOptionalString(rewriteOverride); } }