Removed 1.x version check

This commit is contained in:
Martijn van Groningen 2014-12-02 14:51:44 +01:00
parent 4c159f1140
commit a8a5391255

View File

@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableMap;
import org.apache.lucene.search.Explanation; import org.apache.lucene.search.Explanation;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.Version;
import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
@ -557,9 +556,7 @@ public class InternalSearchHit implements SearchHit {
score = in.readFloat(); score = in.readFloat();
id = in.readText(); id = in.readText();
type = in.readSharedText(); type = in.readSharedText();
if (in.getVersion().onOrAfter(Version.V_1_5_0)) {
nestedIdentity = in.readOptionalStreamable(new InternalNestedIdentity()); nestedIdentity = in.readOptionalStreamable(new InternalNestedIdentity());
}
version = in.readLong(); version = in.readLong();
source = in.readBytesReference(); source = in.readBytesReference();
if (source.length() == 0) { if (source.length() == 0) {
@ -685,7 +682,6 @@ public class InternalSearchHit implements SearchHit {
} }
} }
if (in.getVersion().onOrAfter(Version.V_1_5_0)) {
size = in.readVInt(); size = in.readVInt();
if (size > 0) { if (size > 0) {
innerHits = new HashMap<>(size); innerHits = new HashMap<>(size);
@ -696,7 +692,6 @@ public class InternalSearchHit implements SearchHit {
} }
} }
} }
}
@Override @Override
public void writeTo(StreamOutput out) throws IOException { public void writeTo(StreamOutput out) throws IOException {
@ -707,9 +702,7 @@ public class InternalSearchHit implements SearchHit {
out.writeFloat(score); out.writeFloat(score);
out.writeText(id); out.writeText(id);
out.writeSharedText(type); out.writeSharedText(type);
if (out.getVersion().onOrAfter(Version.V_1_5_0)) {
out.writeOptionalStreamable(nestedIdentity); out.writeOptionalStreamable(nestedIdentity);
}
out.writeLong(version); out.writeLong(version);
out.writeBytesReference(source); out.writeBytesReference(source);
if (explanation == null) { if (explanation == null) {
@ -802,7 +795,6 @@ public class InternalSearchHit implements SearchHit {
} }
} }
if (out.getVersion().onOrAfter(Version.V_1_5_0)) {
if (innerHits == null) { if (innerHits == null) {
out.writeVInt(0); out.writeVInt(0);
} else { } else {
@ -813,7 +805,6 @@ public class InternalSearchHit implements SearchHit {
} }
} }
} }
}
public final static class InternalNestedIdentity implements NestedIdentity, Streamable, ToXContent { public final static class InternalNestedIdentity implements NestedIdentity, Streamable, ToXContent {