Class MultiSearchRequest

All Implemented Interfaces:
CompositeIndicesRequest, Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest

public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest
A multi search API request.
  • Field Details

    • MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT

      public static final int MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
      See Also:
      Constant Field Values
  • Constructor Details

    • MultiSearchRequest

      public MultiSearchRequest()
    • MultiSearchRequest

      public MultiSearchRequest(StreamInput in) throws
      Throws:
  • Method Details

    • add

      public MultiSearchRequest add(SearchRequestBuilder request)
      Add a search request to execute. Note, the order is important, the search response will be returned in the same order as the search requests.
    • add

      public MultiSearchRequest add(SearchRequest request)
      Add a search request to execute. Note, the order is important, the search response will be returned in the same order as the search requests.
    • maxConcurrentSearchRequests

      public int maxConcurrentSearchRequests()
      Returns the amount of search requests specified in this multi search requests are allowed to be ran concurrently.
    • maxConcurrentSearchRequests

      public MultiSearchRequest maxConcurrentSearchRequests(int maxConcurrentSearchRequests)
      Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.
    • requests

      public <SearchRequest> requests()
    • validate

      Specified by:
      validate in class ActionRequest
    • indicesOptions

      public IndicesOptions indicesOptions()
    • indicesOptions

      public MultiSearchRequest indicesOptions(IndicesOptions indicesOptions)
    • writeTo

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

      public boolean equals( o)
      Overrides:
       in class 
    • hashCode

      public int hashCode()
      Overrides:
       in class 
    • readMultiLineFormat

      public static void readMultiLineFormat(BytesReference data, org.elasticsearch.common.xcontent.XContent xContent, > consumer, [] indices, IndicesOptions indicesOptions, [] types,  routing,  searchType,  ccsMinimizeRoundtrips, org.elasticsearch.common.xcontent.NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger) throws
      Throws:
    • writeMultiLineFormat

      public static byte[] writeMultiLineFormat(MultiSearchRequest multiSearchRequest, org.elasticsearch.common.xcontent.XContent xContent) throws
      Throws:
    • writeSearchRequestParams

      public static void writeSearchRequestParams(SearchRequest request, org.elasticsearch.common.xcontent.XContentBuilder xContentBuilder) throws
      Throws:
    • createTask

      public Task createTask(long id,  type,  action, TaskId parentTaskId, <,​> headers)
      Description copied from interface: TaskAwareRequest
      Returns the task object that should be used to keep track of the processing of the request.
      Specified by:
      createTask in interface TaskAwareRequest