Skip to content

Commit

Permalink
Removed minimum version variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Alfonsi committed Oct 20, 2023
1 parent ac6afd3 commit f5db1aa
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ public final class QuerySearchResult extends SearchPhaseResult {

private final boolean isNull;
private long tookTimeNanos;
private final static Version minimumTookTimeVersion = Version.V_3_0_0;

public QuerySearchResult() {
this(false);
Expand Down Expand Up @@ -367,7 +366,7 @@ public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOExc
nodeQueueSize = in.readInt();
setShardSearchRequest(in.readOptionalWriteable(ShardSearchRequest::new));
setRescoreDocIds(new RescoreDocIds(in));
if (in.getVersion().onOrAfter(minimumTookTimeVersion)) {
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
tookTimeNanos = in.readVLong();
} else {
tookTimeNanos = -1L;
Expand Down Expand Up @@ -414,7 +413,7 @@ public void writeToNoId(StreamOutput out) throws IOException {
out.writeInt(nodeQueueSize);
out.writeOptionalWriteable(getShardSearchRequest());
getRescoreDocIds().writeTo(out);
if (out.getVersion().onOrAfter(minimumTookTimeVersion)) {
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
out.writeVLong(tookTimeNanos); // VLong as took time should always be positive
}
}
Expand Down

0 comments on commit f5db1aa

Please sign in to comment.