Keep backwards compatible with 0.90.0 on the transport layer.

Relates to #3039
This commit is contained in:
Martijn van Groningen 2013-05-15 13:28:55 +02:00
parent 585cbf6886
commit 48cb06c9cf
1 changed files with 7 additions and 2 deletions

View File

@ -21,6 +21,7 @@ package org.elasticsearch.action.mlt;
import org.elasticsearch.ElasticSearchGenerationException; import org.elasticsearch.ElasticSearchGenerationException;
import org.elasticsearch.ElasticSearchIllegalArgumentException; import org.elasticsearch.ElasticSearchIllegalArgumentException;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
@ -533,7 +534,6 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
index = in.readString(); index = in.readString();
type = in.readString(); type = in.readString();
id = in.readString(); id = in.readString();
routing = in.readOptionalString();
// no need to pass threading over the network, they are always false when coming throw a thread pool // no need to pass threading over the network, they are always false when coming throw a thread pool
int size = in.readVInt(); int size = in.readVInt();
if (size == 0) { if (size == 0) {
@ -595,6 +595,9 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
searchSize = in.readVInt(); searchSize = in.readVInt();
searchFrom = in.readVInt(); searchFrom = in.readVInt();
if (Version.V_0_90_1.onOrAfter(in.getVersion())) {
routing = in.readOptionalString();
}
} }
@Override @Override
@ -603,7 +606,6 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
out.writeString(index); out.writeString(index);
out.writeString(type); out.writeString(type);
out.writeString(id); out.writeString(id);
out.writeOptionalString(routing);
if (fields == null) { if (fields == null) {
out.writeVInt(0); out.writeVInt(0);
} else { } else {
@ -663,5 +665,8 @@ public class MoreLikeThisRequest extends ActionRequest<MoreLikeThisRequest> {
out.writeVInt(searchSize); out.writeVInt(searchSize);
out.writeVInt(searchFrom); out.writeVInt(searchFrom);
if (Version.V_0_90_1.onOrAfter(out.getVersion())) {
out.writeOptionalString(routing);
}
} }
} }