diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/15_composition.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/15_composition.yml index e2ce42dd8ddf1..9ef465bc1a10b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/15_composition.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_index_template/15_composition.yml @@ -1,7 +1,7 @@ --- "Component and index template composition": - skip: - version: " - 7.9.99" + version: " - 7.7.99" reason: "index template v2 API unavailable before 7.8" features: allowed_warnings @@ -89,7 +89,7 @@ --- "Index template priority": - skip: - version: " - 7.9.99" + version: " - 7.7.99" reason: "index template v2 API unavailable before 7.8" features: allowed_warnings @@ -133,7 +133,7 @@ --- "Component template only composition": - skip: - version: " - 7.9.99" + version: " - 7.7.99" reason: "index template v2 API unavailable before 7.8" features: allowed_warnings @@ -179,7 +179,7 @@ --- "Index template without component templates": - skip: - version: " - 7.9.99" + version: " - 7.7.99" reason: "index template v2 API unavailable before 7.8" features: allowed_warnings @@ -208,8 +208,8 @@ --- "Version 1 templates are preferred if the flag is set": - skip: - version: " - 7.9.99" - reason: "not backported yet" + version: " - 7.7.99" + reason: "index template v2 API unavailable before 7.8" features: allowed_warnings - do: diff --git a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java index 60fc8d300ecdd..cd2ea730f512d 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java @@ -110,7 +110,7 @@ public CreateIndexRequest(StreamInput in) throws IOException { aliases.add(new Alias(in)); } waitForActiveShards = ActiveShardCount.readFrom(in); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_8_0)) { preferV2Templates = in.readOptionalBoolean(); } } @@ -484,7 +484,7 @@ public void writeTo(StreamOutput out) throws IOException { alias.writeTo(out); } waitForActiveShards.writeTo(out); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalBoolean(preferV2Templates); } } diff --git a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java index 9751aee59ba38..8963bb91f9c0b 100644 --- a/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java +++ b/server/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java @@ -89,7 +89,7 @@ public BulkRequest(StreamInput in) throws IOException { } refreshPolicy = RefreshPolicy.readFrom(in); timeout = in.readTimeValue(); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_8_0)) { this.preferV2Templates = in.readOptionalBoolean(); } } @@ -371,7 +371,7 @@ public void writeTo(StreamOutput out) throws IOException { } refreshPolicy.writeTo(out); out.writeTimeValue(timeout); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalBoolean(preferV2Templates); } } diff --git a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java index 7ee41fe6a1d12..cbc4dd84495ff 100644 --- a/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java +++ b/server/src/main/java/org/elasticsearch/action/index/IndexRequest.java @@ -144,7 +144,7 @@ public IndexRequest(StreamInput in) throws IOException { } ifSeqNo = in.readZLong(); ifPrimaryTerm = in.readVLong(); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_8_0)) { this.preferV2Templates = in.readOptionalBoolean(); } } @@ -656,7 +656,7 @@ public void writeTo(StreamOutput out) throws IOException { } out.writeZLong(ifSeqNo); out.writeVLong(ifPrimaryTerm); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalBoolean(preferV2Templates); } } diff --git a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java index 804f6ff819aeb..d9ee2a11593b2 100644 --- a/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java +++ b/server/src/main/java/org/elasticsearch/action/update/UpdateRequest.java @@ -153,7 +153,7 @@ public UpdateRequest(StreamInput in) throws IOException { ifPrimaryTerm = in.readVLong(); detectNoop = in.readBoolean(); scriptedUpsert = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_8_0_0)) { + if (in.getVersion().onOrAfter(Version.V_7_8_0)) { preferV2Templates = in.readOptionalBoolean(); } } @@ -855,7 +855,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(ifPrimaryTerm); out.writeBoolean(detectNoop); out.writeBoolean(scriptedUpsert); - if (out.getVersion().onOrAfter(Version.V_8_0_0)) { + if (out.getVersion().onOrAfter(Version.V_7_8_0)) { out.writeOptionalBoolean(preferV2Templates); } }