java.lang.Iterable<DocumentField>
, Streamable
, ToXContent
, ToXContentObject
public class GetResult extends java.lang.Object implements Streamable, java.lang.Iterable<DocumentField>, ToXContentObject
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
_ID |
|
static java.lang.String |
_INDEX |
|
static java.lang.String |
_TYPE |
EMPTY_PARAMS
Constructor | Description |
---|---|
GetResult(java.lang.String index,
java.lang.String type,
java.lang.String id,
long version,
boolean exists,
BytesReference source,
java.util.Map<java.lang.String,DocumentField> fields) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(java.lang.Object o) |
|
DocumentField |
field(java.lang.String name) |
|
static GetResult |
fromXContent(XContentParser parser) |
|
static GetResult |
fromXContentEmbedded(XContentParser parser) |
|
static GetResult |
fromXContentEmbedded(XContentParser parser,
java.lang.String index,
java.lang.String type,
java.lang.String id) |
|
java.util.Map<java.lang.String,DocumentField> |
getFields() |
|
java.lang.String |
getId() |
The id of the document.
|
java.lang.String |
getIndex() |
The index the document was fetched from.
|
java.util.Map<java.lang.String,java.lang.Object> |
getSource() |
|
java.lang.String |
getType() |
The type of the document.
|
long |
getVersion() |
The version of the doc.
|
int |
hashCode() |
|
BytesReference |
internalSourceRef() |
Internal source representation, might be compressed....
|
boolean |
isExists() |
Does the document exist.
|
boolean |
isSourceEmpty() |
Is the source empty (not available) or not.
|
java.util.Iterator<DocumentField> |
iterator() |
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
static GetResult |
readGetResult(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).
|
BytesReference |
sourceRef() |
Returns bytes reference, also un compress the source if needed.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
XContentBuilder |
toXContentEmbedded(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
public static final java.lang.String _INDEX
public static final java.lang.String _TYPE
public static final java.lang.String _ID
public GetResult(java.lang.String index, java.lang.String type, java.lang.String id, long version, boolean exists, BytesReference source, java.util.Map<java.lang.String,DocumentField> fields)
public boolean isExists()
public java.lang.String getIndex()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
public byte[] source()
public BytesReference sourceRef()
public BytesReference internalSourceRef()
public boolean isSourceEmpty()
public java.lang.String sourceAsString()
public java.util.Map<java.lang.String,java.lang.Object> sourceAsMap() throws ElasticsearchParseException
ElasticsearchParseException
public java.util.Map<java.lang.String,java.lang.Object> getSource()
public java.util.Map<java.lang.String,DocumentField> getFields()
public DocumentField field(java.lang.String name)
public java.util.Iterator<DocumentField> iterator()
iterator
in interface java.lang.Iterable<DocumentField>
public XContentBuilder toXContentEmbedded(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static GetResult fromXContentEmbedded(XContentParser parser) throws java.io.IOException
java.io.IOException
public static GetResult fromXContentEmbedded(XContentParser parser, java.lang.String index, java.lang.String type, java.lang.String id) throws java.io.IOException
java.io.IOException
public static GetResult fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public static GetResult readGetResult(StreamInput in) throws java.io.IOException
java.io.IOException
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object