From 4707377ceab3ab95bb35e67f4da2cb051fbc53d6 Mon Sep 17 00:00:00 2001 From: Jim Ferenczi Date: Tue, 23 May 2017 22:41:39 +0200 Subject: [PATCH] Move InnerHitBuilder queries BWC version to 5.5 after the backport Relates #24676 --- .../index/query/InnerHitBuilder.java | 20 +++++++++---------- .../index/query/NestedQueryBuilder.java | 2 +- .../search/collapse/CollapseBuilder.java | 2 +- .../join/query/HasChildQueryBuilder.java | 2 +- .../join/query/HasParentQueryBuilder.java | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java b/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java index 4419d6a93a6..fde98ee0d41 100644 --- a/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/InnerHitBuilder.java @@ -126,7 +126,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl */ public InnerHitBuilder(StreamInput in) throws IOException { name = in.readOptionalString(); - if (in.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) { + if (in.getVersion().before(Version.V_5_5_0_UNRELEASED)) { in.readOptionalString(); in.readOptionalString(); } @@ -156,7 +156,7 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl } } highlightBuilder = in.readOptionalWriteable(HighlightBuilder::new); - if (in.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) { + if (in.getVersion().before(Version.V_5_5_0_UNRELEASED)) { /** * this is needed for BWC with nodes pre 5.5 */ @@ -168,8 +168,8 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl @Override public void writeTo(StreamOutput out) throws IOException { - if (out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) { - throw new IOException("Invalid output version, must >= " + Version.V_6_0_0_alpha2_UNRELEASED.toString()); + if (out.getVersion().before(Version.V_5_5_0_UNRELEASED)) { + throw new IOException("Invalid output version, must >= " + Version.V_5_5_0_UNRELEASED.toString()); } out.writeOptionalString(name); out.writeBoolean(ignoreUnmapped); @@ -207,8 +207,8 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl * Should only be used to send nested inner hits to nodes pre 5.5. */ protected void writeToNestedBWC(StreamOutput out, QueryBuilder query, String nestedPath) throws IOException { - assert out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED) : - "invalid output version, must be < " + Version.V_6_0_0_alpha2_UNRELEASED.toString(); + assert out.getVersion().before(Version.V_5_5_0_UNRELEASED) : + "invalid output version, must be < " + Version.V_5_5_0_UNRELEASED.toString(); writeToBWC(out, query, nestedPath, null); } @@ -217,8 +217,8 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl * Should only be used to send collapsing inner hits to nodes pre 5.5. */ public void writeToCollapseBWC(StreamOutput out) throws IOException { - assert out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED) : - "invalid output version, must be < " + Version.V_6_0_0_alpha2_UNRELEASED.toString(); + assert out.getVersion().before(Version.V_5_5_0_UNRELEASED) : + "invalid output version, must be < " + Version.V_5_5_0_UNRELEASED.toString(); writeToBWC(out, new MatchAllQueryBuilder(), null, null); } @@ -227,8 +227,8 @@ public final class InnerHitBuilder extends ToXContentToBytes implements Writeabl * Should only be used to send hasParent or hasChild inner hits to nodes pre 5.5. */ public void writeToParentChildBWC(StreamOutput out, QueryBuilder query, String parentChildPath) throws IOException { - assert(out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) : - "invalid output version, must be < " + Version.V_6_0_0_alpha2_UNRELEASED.toString(); + assert(out.getVersion().before(Version.V_5_5_0_UNRELEASED)) : + "invalid output version, must be < " + Version.V_5_5_0_UNRELEASED.toString(); writeToBWC(out, query, null, parentChildPath); } diff --git a/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java index 5ebb074b799..a62b95337f9 100644 --- a/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/NestedQueryBuilder.java @@ -103,7 +103,7 @@ public class NestedQueryBuilder extends AbstractQueryBuilder out.writeString(path); out.writeVInt(scoreMode.ordinal()); out.writeNamedWriteable(query); - if (out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) { + if (out.getVersion().before(Version.V_5_5_0_UNRELEASED)) { final boolean hasInnerHit = innerHitBuilder != null; out.writeBoolean(hasInnerHit); if (hasInnerHit) { diff --git a/core/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java b/core/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java index d89e50c8a4b..9ae8bd2b383 100644 --- a/core/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java +++ b/core/src/main/java/org/elasticsearch/search/collapse/CollapseBuilder.java @@ -82,7 +82,7 @@ public class CollapseBuilder extends ToXContentToBytes implements Writeable { public void writeTo(StreamOutput out) throws IOException { out.writeString(field); out.writeVInt(maxConcurrentGroupRequests); - if (out.getVersion().before(Version.V_6_0_0_alpha2_UNRELEASED)) { + if (out.getVersion().before(Version.V_5_5_0_UNRELEASED)) { final boolean hasInnerHit = innerHit != null; out.writeBoolean(hasInnerHit); if (hasInnerHit) { diff --git a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java index 566edf1cb8c..50fb925de68 100644 --- a/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java +++ b/modules/parent-join/src/main/java/org/elasticsearch/join/query/HasChildQueryBuilder.java @@ -126,7 +126,7 @@ public class HasChildQueryBuilder extends AbstractQueryBuilder