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:
Iterable<MultiGetRequest.Item>
,CompositeIndicesRequest
,RealtimeRequest
,Writeable
,RefCounted
,TaskAwareRequest
,ToXContent
,ToXContentObject
public class MultiGetRequest
extends ActionRequest
implements Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest, ToXContentObject
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.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.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.add
(String defaultIndex, String defaultType, String[] defaultFields, FetchSourceContext defaultFetchSource, String defaultRouting, XContentParser parser, boolean allowExplicitIndex) add
(MultiGetRequest.Item item) getItems()
iterator()
static void
parseIds
(XContentParser parser, List<MultiGetRequest.Item> items, String defaultIndex, String defaultType, String[] defaultFields, FetchSourceContext defaultFetchSource, String defaultRouting) preference
(String preference) Sets the preference to execute the search.boolean
realtime()
realtime
(boolean realtime) boolean
refresh()
refresh
(boolean refresh) toXContent
(XContentBuilder builder, ToXContent.Params params) validate()
void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask, toString
Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
MultiGetRequest
public MultiGetRequest() -
MultiGetRequest
- Throws:
IOException
-
-
Method Details
-
getItems
-
add
-
add
Deprecated.Types are in the process of being removed, useadd(String, String)
instead. -
add
-
validate
- Specified by:
validate
in classActionRequest
-
preference
Sets the preference to execute the search. Defaults to randomize across shards. Can be set to_local
to prefer local shards or a custom value, which guarantees that the same order will be used across different requests. -
preference
-
realtime
public boolean realtime() -
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
-
add
public MultiGetRequest add(@Nullable String defaultIndex, @Nullable String defaultType, @Nullable String[] defaultFields, @Nullable FetchSourceContext defaultFetchSource, @Nullable String defaultRouting, XContentParser parser, boolean allowExplicitIndex) throws IOException - Throws:
IOException
-
parseIds
public static void parseIds(XContentParser parser, List<MultiGetRequest.Item> items, @Nullable String defaultIndex, @Nullable String defaultType, @Nullable String[] defaultFields, @Nullable FetchSourceContext defaultFetchSource, @Nullable String defaultRouting) throws IOException - Throws:
IOException
-
iterator
- Specified by:
iterator
in interfaceIterable<MultiGetRequest.Item>
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classActionRequest
- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
add(String, String)
instead.