Skip to content

Commit 75a0ddb

Browse files
committed
rebase
Signed-off-by: Nicholas Walter Knize <[email protected]>
1 parent ed1944f commit 75a0ddb

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

server/src/main/java/org/opensearch/search/query/QuerySearchResult.java

+5-22
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ public QuerySearchResult() {
9494

9595
public QuerySearchResult(StreamInput in) throws IOException {
9696
super(in);
97-
if (in.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {
98-
isNull = in.readBoolean();
99-
} else {
100-
isNull = false;
101-
}
97+
isNull = in.readBoolean();
10298
if (isNull == false) {
10399
ShardSearchContextId id = new ShardSearchContextId(in);
104100
readFromWithId(id, in);
@@ -354,14 +350,8 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
354350
}
355351
}
356352
setTopDocs(readTopDocs(in));
357-
if (in.getVersion().before(LegacyESVersion.V_7_7_0)) {
358-
if (hasAggs = in.readBoolean()) {
359-
aggregations = DelayableWriteable.referencing(InternalAggregations.readFrom(in));
360-
}
361-
} else {
362-
if (hasAggs = in.readBoolean()) {
363-
aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in);
364-
}
353+
if (hasAggs = in.readBoolean()) {
354+
aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in);
365355
}
366356
if (in.readBoolean()) {
367357
suggest = new Suggest(in);
@@ -378,9 +368,7 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
378368

379369
@Override
380370
public void writeTo(StreamOutput out) throws IOException {
381-
if (out.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {
382-
out.writeBoolean(isNull);
383-
}
371+
out.writeBoolean(isNull);
384372
if (isNull == false) {
385373
contextId.writeTo(out);
386374
writeToNoId(out);
@@ -403,12 +391,7 @@ public void writeToNoId(StreamOutput out) throws IOException {
403391
out.writeBoolean(false);
404392
} else {
405393
out.writeBoolean(true);
406-
if (out.getVersion().before(LegacyESVersion.V_7_7_0)) {
407-
InternalAggregations aggs = aggregations.expand();
408-
aggs.writeTo(out);
409-
} else {
410-
aggregations.writeTo(out);
411-
}
394+
aggregations.writeTo(out);
412395
}
413396
if (suggest == null) {
414397
out.writeBoolean(false);

0 commit comments

Comments
 (0)