org.elasticsearch.action.get
Class GetResponse

java.lang.Object
  extended by org.elasticsearch.action.get.GetResponse
All Implemented Interfaces:
java.lang.Iterable<GetField>, ActionResponse, Streamable

public class GetResponse
extends java.lang.Object
implements ActionResponse, Streamable, java.lang.Iterable<GetField>

The response of a get action.

See Also:
GetRequest, Client.get(GetRequest)

Method Summary
 boolean exists()
          Does the document exists.
 GetField field(java.lang.String name)
           
 java.util.Map<java.lang.String,GetField> fields()
           
 java.lang.String id()
          The id of the document.
 java.lang.String index()
          The index the document was fetched from.
 java.util.Iterator<GetField> iterator()
           
 void readFrom(StreamInput in)
           
 byte[] source()
          The source of the document if exists.
 java.util.Map<java.lang.String,java.lang.Object> sourceAsMap()
          The source of the document (As a map).
 java.lang.String sourceAsString()
          The source of the document (as a string).
 java.lang.String type()
          The type of the document.
 void writeTo(StreamOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

exists

public boolean exists()
Does the document exists.


index

public java.lang.String index()
The index the document was fetched from.


type

public java.lang.String type()
The type of the document.


id

public java.lang.String id()
The id of the document.


source

public byte[] source()
The source of the document if exists.


sourceAsString

public java.lang.String sourceAsString()
The source of the document (as a string).


sourceAsMap

public java.util.Map<java.lang.String,java.lang.Object> sourceAsMap()
                                                             throws ElasticSearchParseException
The source of the document (As a map).

Throws:
ElasticSearchParseException

fields

public java.util.Map<java.lang.String,GetField> fields()

field

public GetField field(java.lang.String name)

iterator

public java.util.Iterator<GetField> iterator()
Specified by:
iterator in interface java.lang.Iterable<GetField>

readFrom

public void readFrom(StreamInput in)
              throws java.io.IOException
Specified by:
readFrom in interface Streamable
Throws:
java.io.IOException

writeTo

public void writeTo(StreamOutput out)
             throws java.io.IOException
Specified by:
writeTo in interface Streamable
Throws:
java.io.IOException