Skip to content

Commit

Permalink
Search Hit Refactoring BWC
Browse files Browse the repository at this point in the history
Charge wire version for SearchHit fields to 7.8

related to elastic#41656, elastic#54584
  • Loading branch information
mayya-sharipova authored and franyang committed Apr 17, 2020
1 parent 82a8992 commit d697597
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/main/java/org/elasticsearch/search/SearchHit.java
Expand Up @@ -166,7 +166,7 @@ public SearchHit(StreamInput in) throws IOException {
if (in.readBoolean()) {
explanation = readExplanation(in);
}
if (in.getVersion().onOrAfter(Version.V_8_0_0)) {
if (in.getVersion().onOrAfter(Version.V_7_8_0)) {
documentFields = in.readMap(StreamInput::readString, DocumentField::new);
metaFields = in.readMap(StreamInput::readString, DocumentField::new);
} else {
Expand Down Expand Up @@ -268,7 +268,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeBoolean(true);
writeExplanation(out, explanation);
}
if (out.getVersion().onOrAfter(Version.V_8_0_0)) {
if (out.getVersion().onOrAfter(Version.V_7_8_0)) {
out.writeMap(documentFields, StreamOutput::writeString, (stream, documentField) -> documentField.writeTo(stream));
out.writeMap(metaFields, StreamOutput::writeString, (stream, documentField) -> documentField.writeTo(stream));
} else {
Expand Down

0 comments on commit d697597

Please sign in to comment.