Package org.elasticsearch.index.get
Class GetResult
java.lang.Object
org.elasticsearch.index.get.GetResult
- All Implemented Interfaces:
Iterable<DocumentField>
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
public class GetResult
extends Object
implements Writeable, Iterable<DocumentField>, org.elasticsearch.common.xcontent.ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.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.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionGetResult(String index, String type, 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 TypeMethodDescriptionboolean
static GetResult
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
static GetResult
fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser)
static GetResult
fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser, String index, String type, String id)
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.getType()
The type of the document.long
The version of the doc.int
hashCode()
Internal source representation, might be compressed....boolean
isExists()
Does the document exist.boolean
Is the source empty (not available) or not.iterator()
byte[]
source()
The source of the document if exists.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()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
org.elasticsearch.common.xcontent.XContentBuilder
toXContentEmbedded(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.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.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
_INDEX
- See Also:
- Constant Field Values
-
_TYPE
- See Also:
- Constant Field Values
-
_ID
- See Also:
- Constant Field Values
-
-
Constructor Details
-
GetResult
- Throws:
IOException
-
GetResult
public GetResult(String index, String type, 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. -
getType
The type of the document. -
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. -
source
public byte[] source()The source of the document if exists. -
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
-
getSource
-
getMetadataFields
-
getDocumentFields
-
getFields
-
field
-
iterator
- Specified by:
iterator
in interfaceIterable<DocumentField>
-
toXContentEmbedded
public org.elasticsearch.common.xcontent.XContentBuilder toXContentEmbedded(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Throws:
IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
fromXContentEmbedded
public static GetResult fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- Throws:
IOException
-
fromXContentEmbedded
public static GetResult fromXContentEmbedded(org.elasticsearch.common.xcontent.XContentParser parser, String index, String type, String id) throws IOException- Throws:
IOException
-
fromXContent
public static GetResult fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws IOException- 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
-