|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.action.support.single.SingleOperationRequest org.elasticsearch.action.get.GetRequest
public class GetRequest
A request to get a document (its source) from an index based on its type and id. Best created using
Requests.getRequest(String)
.
The operation requires the SingleOperationRequest.index()
, type(String)
and id(String)
to be set.
GetResponse
,
Requests.getRequest(String)
,
Client.get(GetRequest)
Field Summary |
---|
Fields inherited from class org.elasticsearch.action.support.single.SingleOperationRequest |
---|
id, index, type |
Constructor Summary | |
---|---|
GetRequest(java.lang.String index)
Constructs a new get request against the specified index. |
|
GetRequest(java.lang.String index,
java.lang.String type,
java.lang.String id)
Constructs a new get request against the specified index with the type and id. |
Method Summary | |
---|---|
java.lang.String[] |
fields()
Explicitly specify the fields that will be returned. |
GetRequest |
fields(java.lang.String... fields)
Explicitly specify the fields that will be returned. |
GetRequest |
id(java.lang.String id)
Sets the id of the document to fetch. |
GetRequest |
listenerThreaded(boolean threadedListener)
Should the listener be called on a separate thread if needed. |
GetRequest |
operationThreaded(boolean threadedOperation)
Controls if the operation will be executed on a separate thread when executed locally. |
void |
readFrom(StreamInput in)
|
java.lang.String |
toString()
|
GetRequest |
type(java.lang.String type)
Sets the type of the document to fetch. |
void |
writeTo(StreamOutput out)
|
Methods inherited from class org.elasticsearch.action.support.single.SingleOperationRequest |
---|
id, index, listenerThreaded, operationThreaded, type, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GetRequest(java.lang.String index)
type(String)
and id(String)
must be set.
public GetRequest(java.lang.String index, java.lang.String type, java.lang.String id)
index
- The index to get the document fromtype
- The type of the documentid
- The id of the documentMethod Detail |
---|
@Required public GetRequest type(java.lang.String type)
@Required public GetRequest id(java.lang.String id)
public GetRequest fields(java.lang.String... fields)
public java.lang.String[] fields()
public GetRequest listenerThreaded(boolean threadedListener)
listenerThreaded
in interface ActionRequest
listenerThreaded
in class SingleOperationRequest
public GetRequest operationThreaded(boolean threadedOperation)
operationThreaded
in class SingleOperationRequest
public void readFrom(StreamInput in) throws java.io.IOException
readFrom
in interface Streamable
readFrom
in class SingleOperationRequest
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
writeTo
in interface Streamable
writeTo
in class SingleOperationRequest
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |