|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.action.support.single.shard.SingleShardOperationRequest org.elasticsearch.action.get.GetRequest
public class GetRequest
A request to get a document (its source) from an index based on its type (optional) and id. Best created using
Requests.getRequest(String)
.
The operation requires the SingleShardOperationRequest.index()
, type(String)
and id(String)
to be set.
GetResponse
,
Requests.getRequest(String)
,
Client.get(GetRequest)
Field Summary | |
---|---|
protected String |
id
|
protected String |
preference
|
protected String |
routing
|
protected String |
type
|
Fields inherited from class org.elasticsearch.action.support.single.shard.SingleShardOperationRequest |
---|
index |
Constructor Summary | |
---|---|
GetRequest(String index)
Constructs a new get request against the specified index. |
|
GetRequest(String index,
String type,
String id)
Constructs a new get request against the specified index with the type and id. |
Method Summary | |
---|---|
String[] |
fields()
Explicitly specify the fields that will be returned. |
GetRequest |
fields(String... fields)
Explicitly specify the fields that will be returned. |
String |
id()
|
GetRequest |
id(String id)
Sets the id of the document to fetch. |
GetRequest |
index(String index)
Sets the index 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. |
GetRequest |
parent(String parent)
Sets the parent id of this document. |
String |
preference()
|
GetRequest |
preference(String preference)
Sets the preference to execute the search. |
void |
readFrom(StreamInput in)
|
boolean |
realtime()
|
GetRequest |
realtime(Boolean realtime)
|
boolean |
refresh()
|
GetRequest |
refresh(boolean refresh)
Should a refresh be executed before this get operation causing the operation to return the latest value. |
String |
routing()
|
GetRequest |
routing(String routing)
Controls the shard routing of the request. |
String |
toString()
|
String |
type()
|
GetRequest |
type(String type)
Sets the type of the document to fetch. |
ActionRequestValidationException |
validate()
|
void |
writeTo(StreamOutput out)
|
Methods inherited from class org.elasticsearch.action.support.single.shard.SingleShardOperationRequest |
---|
beforeLocalFork, index, listenerThreaded, operationThreaded |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected String type
protected String id
protected String routing
protected String preference
Constructor Detail |
---|
public GetRequest(String index)
type(String)
and id(String)
must be set.
public GetRequest(String index, String type, String id)
index
- The index to get the document fromtype
- The type of the documentid
- The id of the documentMethod Detail |
---|
public ActionRequestValidationException validate()
validate
in interface ActionRequest
validate
in class SingleShardOperationRequest
@Required public GetRequest index(String index)
public GetRequest type(@Nullable String type)
@Required public GetRequest id(String id)
public GetRequest parent(String parent)
public GetRequest routing(String routing)
public GetRequest preference(String preference)
public String type()
public String id()
public String routing()
public String preference()
public GetRequest fields(String... fields)
public String[] fields()
public GetRequest refresh(boolean refresh)
public boolean refresh()
public boolean realtime()
public GetRequest realtime(Boolean realtime)
public GetRequest listenerThreaded(boolean threadedListener)
listenerThreaded
in interface ActionRequest
listenerThreaded
in class SingleShardOperationRequest
public GetRequest operationThreaded(boolean threadedOperation)
operationThreaded
in class SingleShardOperationRequest
public void readFrom(StreamInput in) throws IOException
readFrom
in interface Streamable
readFrom
in class SingleShardOperationRequest
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class SingleShardOperationRequest
IOException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |