java.lang.Object
org.elasticsearch.index.get.GetResult
- All Implemented Interfaces:
Iterable<DocumentField>,Writeable,ToXContent,ToXContentObject
public class GetResult
extends Object
implements Writeable, Iterable<DocumentField>, ToXContentObject
-
Nested Class Summary
Nested 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
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionGetResult(String index, String id, long seqNo, long primaryTerm, long version, boolean exists, BytesReference source, Map<String, DocumentField> documentFields, Map<String, DocumentField> metaFields) GetResult(StreamInput in) -
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.longThe version of the doc.inthashCode()Internal source representation, might be compressed....booleanisExists()Does the document exist.booleanIs the source empty (not available) or not.iterator()The source of the document (As a map).The source of the document (as a string).Returns bytes reference, also un compress the source if needed.toString()toXContent(XContentBuilder builder, ToXContent.Params params) toXContentEmbedded(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods 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.xcontent.ToXContentObject
isFragment
-
Field Details
-
_INDEX
- See Also:
-
_ID
- See Also:
-
-
Constructor Details
-
GetResult
- Throws:
IOException
-
GetResult
public GetResult(String index, String id, long seqNo, long primaryTerm, long version, boolean exists, BytesReference source, Map<String, DocumentField> documentFields, Map<String, DocumentField> metaFields)
-
-
Method Details
-
isExists
public boolean isExists()Does the document exist. -
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. -
sourceRef
Returns bytes reference, also un compress the source if needed. -
internalSourceRef
Internal source representation, might be compressed.... -
isSourceEmpty
public boolean isSourceEmpty()Is the source empty (not available) or not. -
sourceAsString
The source of the document (as a string). -
sourceAsMap
The source of the document (As a map).- Throws:
ElasticsearchParseException
-
getMetadataFields
-
getDocumentFields
-
getFields
-
field
-
iterator
- Specified by:
iteratorin interfaceIterable<DocumentField>
-
toXContentEmbedded
public XContentBuilder toXContentEmbedded(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
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
-