Adapt bwc version after backport

Relates #33587
This commit is contained in:
Jim Ferenczi 2018-10-05 13:07:08 +02:00
parent 7d57bdb3a0
commit 5c7b52e930
1 changed files with 2 additions and 4 deletions

View File

@ -54,7 +54,7 @@ public class NestedSortBuilder implements Writeable, ToXContentObject {
path = in.readOptionalString();
filter = in.readOptionalNamedWriteable(QueryBuilder.class);
nestedSort = in.readOptionalWriteable(NestedSortBuilder::new);
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
maxChildren = in.readVInt();
} else {
maxChildren = Integer.MAX_VALUE;
@ -98,10 +98,8 @@ public class NestedSortBuilder implements Writeable, ToXContentObject {
out.writeOptionalString(path);
out.writeOptionalNamedWriteable(filter);
out.writeOptionalWriteable(nestedSort);
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
out.writeVInt(maxChildren);
} else {
out.writeVInt(Integer.MAX_VALUE);
}
}