From 6ab1c9e4426b19af26db98eaf7ca3bc2084b07c3 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Sun, 18 Mar 2012 12:06:16 +0200 Subject: [PATCH] Get/MultiGet API with no type provided and doc does not exists causes a failure, closes #1794. --- src/main/java/org/elasticsearch/index/get/GetResult.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/elasticsearch/index/get/GetResult.java b/src/main/java/org/elasticsearch/index/get/GetResult.java index b8d9f8f404e..04a2aedb2c8 100644 --- a/src/main/java/org/elasticsearch/index/get/GetResult.java +++ b/src/main/java/org/elasticsearch/index/get/GetResult.java @@ -309,7 +309,7 @@ public class GetResult implements Streamable, Iterable, ToXContent { @Override public void readFrom(StreamInput in) throws IOException { index = in.readUTF(); - type = in.readUTF(); + type = in.readOptionalUTF(); id = in.readUTF(); version = in.readLong(); exists = in.readBoolean(); @@ -334,7 +334,7 @@ public class GetResult implements Streamable, Iterable, ToXContent { @Override public void writeTo(StreamOutput out) throws IOException { out.writeUTF(index); - out.writeUTF(type); + out.writeOptionalUTF(type); out.writeUTF(id); out.writeLong(version); out.writeBoolean(exists);