java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.get.GetResponse
- All Implemented Interfaces:
Iterable<DocumentField>,Writeable,RefCounted,ToXContent,ToXContentObject
public class GetResponse
extends ActionResponse
implements Iterable<DocumentField>, ToXContentObject
The response of a get action.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetId()The id of the document.getIndex()The index the document was fetched from.longThe primary term of the last primary that has changed this document, if found.longgetSeqNo()The sequence number assigned to the last operation that has changed this document, if found.Returns bytes reference, also un compress the source if needed.The source of the document (As a map).The source of the document (as a string).Returns the internal source bytes, as they are returned without munging (for example, might still be compressed).longThe version of the doc.inthashCode()booleanisExists()Does the document exists.booleanIs the source empty (not available) or not.iterator()Deprecated.toString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
GetResponse
- Throws:
IOException
-
GetResponse
-
-
Method Details
-
isExists
public boolean isExists()Does the document exists. -
getIndex
The index the document was fetched from. -
getId
The id of the document. -
getVersion
public long getVersion()The version of the doc. -
getSeqNo
public long getSeqNo()The sequence number assigned to the last operation that has changed this document, if found. -
getPrimaryTerm
public long getPrimaryTerm()The primary term of the last primary that has changed this document, if found. -
getSourceInternal
Returns the internal source bytes, as they are returned without munging (for example, might still be compressed). -
getSourceAsBytesRef
Returns bytes reference, also un compress the source if needed. -
isSourceEmpty
public boolean isSourceEmpty()Is the source empty (not available) or not. -
getSourceAsString
The source of the document (as a string). -
getSourceAsMap
The source of the document (As a map).- Throws:
ElasticsearchParseException
-
getSource
-
getFields
-
getField
-
iterator
Deprecated.UsegetSource()instead- Specified by:
iteratorin interfaceIterable<DocumentField>
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
getSource()instead