From c62b0192d010f209631f4d80c1e8c00876f52bed Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Mon, 11 Sep 2017 13:09:44 +0200 Subject: [PATCH] #26496: Set the correct bwc version after backport to 6.x --- .../search/suggest/completion/CompletionSuggestion.java | 6 ++---- .../suggest/completion/CompletionSuggestionBuilder.java | 6 ++---- .../resources/rest-api-spec/test/suggest/20_completion.yml | 4 ++-- .../resources/rest-api-spec/test/suggest/30_context.yml | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java index 9d540b57ef16e..6d5cd9e588a36 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestion.java @@ -89,8 +89,7 @@ public CompletionSuggestion(String name, int size, boolean skipDuplicates) { @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); - // TODO should be backported to 6.1.0 - if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (in.getVersion().onOrAfter(Version.V_6_1_0)) { skipDuplicates = in.readBoolean(); } } @@ -98,8 +97,7 @@ public void readFrom(StreamInput in) throws IOException { @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - // TODO should be backported to 6.1.0 - if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (out.getVersion().onOrAfter(Version.V_6_1_0)) { out.writeBoolean(skipDuplicates); } } diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java index 026dc45a1203c..224204bfc8dd3 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestionBuilder.java @@ -128,8 +128,7 @@ public CompletionSuggestionBuilder(StreamInput in) throws IOException { fuzzyOptions = in.readOptionalWriteable(FuzzyOptions::new); regexOptions = in.readOptionalWriteable(RegexOptions::new); contextBytes = in.readOptionalBytesReference(); - // TODO should be backported to 6.1.0 - if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (in.getVersion().onOrAfter(Version.V_6_1_0)) { skipDuplicates = in.readBoolean(); } } @@ -139,8 +138,7 @@ public void doWriteTo(StreamOutput out) throws IOException { out.writeOptionalWriteable(fuzzyOptions); out.writeOptionalWriteable(regexOptions); out.writeOptionalBytesReference(contextBytes); - // TODO should be backported to 6.1.0 - if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) { + if (out.getVersion().onOrAfter(Version.V_6_1_0)) { out.writeBoolean(skipDuplicates); } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/20_completion.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/20_completion.yml index 2b2f5934185f5..3ac9b4ee2ddc4 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/20_completion.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/20_completion.yml @@ -295,8 +295,8 @@ setup: --- "Skip duplicates should work": - skip: - version: " - 6.99.99" - reason: skip_duplicates was added in 7.0 (TODO should be backported to 6.1) + version: " - 6.0.99" + reason: skip_duplicates was added in 6.1 - do: index: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/30_context.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/30_context.yml index ee2801df67d99..f0d97382eeb8e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/30_context.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/suggest/30_context.yml @@ -281,8 +281,8 @@ setup: --- "Skip duplicates with contexts should work": - skip: - version: " - 6.99.99" - reason: skip_duplicates was added in 7.0 (TODO should be backported to 6.1) + version: " - 6.0.99" + reason: skip_duplicates was added in 6.1 - do: index: