|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 java.lang.String |
id
|
protected java.lang.String |
preference
|
protected java.lang.String |
routing
|
protected java.lang.String |
type
|
Fields inherited from class org.elasticsearch.action.support.single.shard.SingleShardOperationRequest |
---|
index |
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. |
java.lang.String |
id()
|
GetRequest |
id(java.lang.String id)
Sets the id of the document to fetch. |
GetRequest |
index(java.lang.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. |
java.lang.String |
preference()
|
GetRequest |
preference(java.lang.String preference)
Sets the preference to execute the search. |
void |
readFrom(StreamInput in)
|
boolean |
realtime()
|
GetRequest |
realtime(java.lang.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. |
java.lang.String |
routing()
|
GetRequest |
routing(java.lang.String routing)
Controls the shard routing of the request. |
java.lang.String |
toString()
|
java.lang.String |
type()
|
GetRequest |
type(java.lang.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 |
---|
index, listenerThreaded, operationThreaded |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String type
protected java.lang.String id
protected java.lang.String routing
protected java.lang.String preference
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 |
---|
public ActionRequestValidationException validate()
validate
in interface ActionRequest
validate
in class SingleShardOperationRequest
@Required public GetRequest index(java.lang.String index)
public GetRequest type(@Nullable java.lang.String type)
@Required public GetRequest id(java.lang.String id)
public GetRequest routing(java.lang.String routing)
public GetRequest preference(java.lang.String preference)
public java.lang.String type()
public java.lang.String id()
public java.lang.String routing()
public java.lang.String preference()
public GetRequest fields(java.lang.String... fields)
public java.lang.String[] fields()
public GetRequest refresh(boolean refresh)
public boolean refresh()
public boolean realtime()
public GetRequest realtime(java.lang.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 java.io.IOException
readFrom
in interface Streamable
readFrom
in class SingleShardOperationRequest
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
writeTo
in interface Streamable
writeTo
in class SingleShardOperationRequest
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 |