Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Oct 20, 2022
1 parent ed1944f commit 75a0ddb
Showing 1 changed file with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ public QuerySearchResult() {

public QuerySearchResult(StreamInput in) throws IOException {
super(in);
if (in.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {
isNull = in.readBoolean();
} else {
isNull = false;
}
isNull = in.readBoolean();
if (isNull == false) {
ShardSearchContextId id = new ShardSearchContextId(in);
readFromWithId(id, in);
Expand Down Expand Up @@ -354,14 +350,8 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
}
}
setTopDocs(readTopDocs(in));
if (in.getVersion().before(LegacyESVersion.V_7_7_0)) {
if (hasAggs = in.readBoolean()) {
aggregations = DelayableWriteable.referencing(InternalAggregations.readFrom(in));
}
} else {
if (hasAggs = in.readBoolean()) {
aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in);
}
if (hasAggs = in.readBoolean()) {
aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in);
}
if (in.readBoolean()) {
suggest = new Suggest(in);
Expand All @@ -378,9 +368,7 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc

@Override
public void writeTo(StreamOutput out) throws IOException {
if (out.getVersion().onOrAfter(LegacyESVersion.V_7_7_0)) {
out.writeBoolean(isNull);
}
out.writeBoolean(isNull);
if (isNull == false) {
contextId.writeTo(out);
writeToNoId(out);
Expand All @@ -403,12 +391,7 @@ public void writeToNoId(StreamOutput out) throws IOException {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
if (out.getVersion().before(LegacyESVersion.V_7_7_0)) {
InternalAggregations aggs = aggregations.expand();
aggs.writeTo(out);
} else {
aggregations.writeTo(out);
}
aggregations.writeTo(out);
}
if (suggest == null) {
out.writeBoolean(false);
Expand Down

0 comments on commit 75a0ddb

Please sign in to comment.