@@ -94,11 +94,7 @@ public QuerySearchResult() {
94
94
95
95
public QuerySearchResult (StreamInput in ) throws IOException {
96
96
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 ();
102
98
if (isNull == false ) {
103
99
ShardSearchContextId id = new ShardSearchContextId (in );
104
100
readFromWithId (id , in );
@@ -354,14 +350,8 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
354
350
}
355
351
}
356
352
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 );
365
355
}
366
356
if (in .readBoolean ()) {
367
357
suggest = new Suggest (in );
@@ -378,9 +368,7 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
378
368
379
369
@ Override
380
370
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 );
384
372
if (isNull == false ) {
385
373
contextId .writeTo (out );
386
374
writeToNoId (out );
@@ -403,12 +391,7 @@ public void writeToNoId(StreamOutput out) throws IOException {
403
391
out .writeBoolean (false );
404
392
} else {
405
393
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 );
412
395
}
413
396
if (suggest == null ) {
414
397
out .writeBoolean (false );
0 commit comments