Package org.elasticsearch.action.get
Class MultiGetRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.get.MultiGetRequest
-
- All Implemented Interfaces:
java.lang.Iterable<MultiGetRequest.Item>
,CompositeIndicesRequest
,RealtimeRequest
,Streamable
,Writeable
,ToXContent
,ToXContentObject
,TaskAwareRequest
public class MultiGetRequest extends ActionRequest implements java.lang.Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest, ToXContentObject
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MultiGetRequest.Item
A single get item.-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description MultiGetRequest()
-
Method Summary
Modifier and Type Method Description MultiGetRequest
add(java.lang.String index, java.lang.String type, java.lang.String id)
MultiGetRequest
add(java.lang.String defaultIndex, java.lang.String defaultType, java.lang.String[] defaultFields, FetchSourceContext defaultFetchSource, java.lang.String defaultRouting, XContentParser parser, boolean allowExplicitIndex)
MultiGetRequest
add(MultiGetRequest.Item item)
java.util.List<MultiGetRequest.Item>
getItems()
java.util.Iterator<MultiGetRequest.Item>
iterator()
static void
parseIds(XContentParser parser, java.util.List<MultiGetRequest.Item> items)
static void
parseIds(XContentParser parser, java.util.List<MultiGetRequest.Item> items, java.lang.String defaultIndex, java.lang.String defaultType, java.lang.String[] defaultFields, FetchSourceContext defaultFetchSource, java.lang.String defaultRouting)
java.lang.String
preference()
MultiGetRequest
preference(java.lang.String preference)
Sets the preference to execute the search.void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.boolean
realtime()
MultiGetRequest
realtime(boolean realtime)
boolean
refresh()
MultiGetRequest
refresh(boolean refresh)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
ActionRequestValidationException
validate()
void
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
-
-
-
Method Detail
-
getItems
public java.util.List<MultiGetRequest.Item> getItems()
-
add
public MultiGetRequest add(MultiGetRequest.Item item)
-
add
public MultiGetRequest add(java.lang.String index, @Nullable java.lang.String type, java.lang.String id)
-
validate
public ActionRequestValidationException validate()
- Specified by:
validate
in classActionRequest
-
preference
public MultiGetRequest preference(java.lang.String preference)
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to_local
to prefer local shards,_primary
to execute only on primary shards, or a custom value, which guarantees that the same order will be used across different requests.
-
preference
public java.lang.String preference()
-
realtime
public boolean realtime()
-
realtime
public MultiGetRequest realtime(boolean realtime)
- Specified by:
realtime
in interfaceRealtimeRequest
- Parameters:
realtime
- Controls whether this request should be realtime by reading from the translog.
-
refresh
public boolean refresh()
-
refresh
public MultiGetRequest refresh(boolean refresh)
-
add
public MultiGetRequest add(@Nullable java.lang.String defaultIndex, @Nullable java.lang.String defaultType, @Nullable java.lang.String[] defaultFields, @Nullable FetchSourceContext defaultFetchSource, @Nullable java.lang.String defaultRouting, XContentParser parser, boolean allowExplicitIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
parseIds
public static void parseIds(XContentParser parser, java.util.List<MultiGetRequest.Item> items, @Nullable java.lang.String defaultIndex, @Nullable java.lang.String defaultType, @Nullable java.lang.String[] defaultFields, @Nullable FetchSourceContext defaultFetchSource, @Nullable java.lang.String defaultRouting) throws java.io.IOException
- Throws:
java.io.IOException
-
parseIds
public static void parseIds(XContentParser parser, java.util.List<MultiGetRequest.Item> items) throws java.io.IOException
- Throws:
java.io.IOException
-
iterator
public java.util.Iterator<MultiGetRequest.Item> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<MultiGetRequest.Item>
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classActionRequest
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classActionRequest
- Throws:
java.io.IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
-