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
,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
-
Constructor Summary
Constructors Constructor Description MultiGetRequest()
MultiGetRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description MultiGetRequest
add(java.lang.String index, java.lang.String id)
MultiGetRequest
add(java.lang.String index, java.lang.String type, java.lang.String id)
Deprecated.Types are in the process of being removed, useadd(String, String)
instead.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.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 into the StreamOutput.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
-
Constructor Details
-
MultiGetRequest
public MultiGetRequest() -
MultiGetRequest
- Throws:
java.io.IOException
-
-
Method Details
-
getItems
-
add
-
add
@Deprecated public MultiGetRequest add(java.lang.String index, @Nullable java.lang.String type, java.lang.String id)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
public java.lang.String 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 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
- Specified by:
iterator
in interfacejava.lang.Iterable<MultiGetRequest.Item>
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- 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
-