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.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested 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_REFERENCED
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getId()
The id of the document.getIndex()
The index the document was fetched from.long
The primary term of the last primary that has changed this document, if found.long
getSeqNo()
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).long
The version of the doc.int
hashCode()
boolean
isExists()
Does the document exists.boolean
Is the source empty (not available) or not.iterator()
Deprecated.toString()
toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
Methods 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:
iterator
in interfaceIterable<DocumentField>
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-
getSource()
instead