Class MultiGetRequest

All Implemented Interfaces:
java.lang.Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest, Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentObject, TaskAwareRequest

public class MultiGetRequest
extends ActionRequest
implements java.lang.Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest, org.elasticsearch.common.xcontent.ToXContentObject
  • Constructor Details

  • Method Details

    • getItems

      public java.util.List<MultiGetRequest.Item> getItems()
    • add

      public MultiGetRequest add​(MultiGetRequest.Item item)
    • 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, use add(String, String) instead.
    • add

      public MultiGetRequest add​(java.lang.String index, java.lang.String id)
    • validate

      Specified by:
      validate in class ActionRequest
    • 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 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 interface RealtimeRequest
      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, org.elasticsearch.common.xcontent.XContentParser parser, boolean allowExplicitIndex) throws java.io.IOException
      Throws:
      java.io.IOException
    • parseIds

      public static void parseIds​(org.elasticsearch.common.xcontent.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
    • iterator

      public java.util.Iterator<MultiGetRequest.Item> iterator()
      Specified by:
      iterator in interface java.lang.Iterable<MultiGetRequest.Item>
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class ActionRequest
      Throws:
      java.io.IOException
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
      java.io.IOException