public class GetResponse extends ActionResponse implements Iterable<GetField>, ToXContent
GetRequest,
Client.get(GetRequest)TransportResponse.EmptyToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsheadersEMPTY_PARAMS| Constructor and Description |
|---|
GetResponse(GetResult getResult) |
| Modifier and Type | Method and Description |
|---|---|
GetField |
getField(String name) |
Map<String,GetField> |
getFields() |
String |
getId()
The id of the document.
|
String |
getIndex()
The index the document was fetched from.
|
Map<String,Object> |
getSource() |
byte[] |
getSourceAsBytes()
The source of the document if exists.
|
BytesReference |
getSourceAsBytesRef()
Returns bytes reference, also un compress the source if needed.
|
Map<String,Object> |
getSourceAsMap()
The source of the document (As a map).
|
String |
getSourceAsString()
The source of the document (as a string).
|
BytesReference |
getSourceInternal()
Returns the internal source bytes, as they are returned without munging (for example,
might still be compressed).
|
String |
getType()
The type of the document.
|
long |
getVersion()
The version of the doc.
|
boolean |
isExists()
Does the document exists.
|
boolean |
isSourceEmpty()
Is the source empty (not available) or not.
|
Iterator<GetField> |
iterator() |
void |
readFrom(StreamInput in) |
static GetResponse |
readGetResponse(StreamInput in) |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out) |
remoteAddress, remoteAddresscontextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContextpublic GetResponse(GetResult getResult)
public boolean isExists()
public String getIndex()
public String getType()
public String getId()
public long getVersion()
public byte[] getSourceAsBytes()
public BytesReference getSourceInternal()
public BytesReference getSourceAsBytesRef()
public boolean isSourceEmpty()
public String getSourceAsString()
public Map<String,Object> getSourceAsMap() throws ElasticsearchParseException
ElasticsearchParseExceptionpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent in interface ToXContentIOExceptionpublic static GetResponse readGetResponse(StreamInput in) throws IOException
IOExceptionpublic void readFrom(StreamInput in) throws IOException
readFrom in interface StreamablereadFrom in class ActionResponseIOExceptionpublic void writeTo(StreamOutput out) throws IOException
writeTo in interface StreamablewriteTo in class ActionResponseIOExceptionCopyright © 2009–2017. All rights reserved.