fix serialization of count request

This commit is contained in:
kimchy 2011-01-06 20:44:36 +02:00
parent 6a0a9ff374
commit c7cb353956

View File

@ -84,7 +84,9 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
@Override public void readFrom(StreamInput in) throws IOException {
super.readFrom(in);
minScore = in.readFloat();
querySource = new byte[in.readVInt()];
querySourceLength = in.readVInt();
querySourceOffset = 0;
querySource = new byte[querySourceLength];
in.readFully(querySource);
if (in.readBoolean()) {
queryParserName = in.readUTF();
@ -101,8 +103,8 @@ class ShardCountRequest extends BroadcastShardOperationRequest {
@Override public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeFloat(minScore);
out.writeVInt(querySource.length);
out.writeBytes(querySource);
out.writeVInt(querySourceLength);
out.writeBytes(querySource, querySourceOffset, querySourceLength);
if (queryParserName == null) {
out.writeBoolean(false);
} else {