Class MultiSearchRequest

All Implemented Interfaces:
CompositeIndicesRequest, Writeable, org.elasticsearch.common.util.concurrent.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 java.io.IOException
      Throws:
      java.io.IOException
  • 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 java.util.List<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 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
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object
    • readMultiLineFormat

      public static void readMultiLineFormat​(BytesReference data, org.elasticsearch.common.xcontent.XContent xContent, CheckedBiConsumer<SearchRequest,​org.elasticsearch.common.xcontent.XContentParser,​java.io.IOException> consumer, java.lang.String[] indices, IndicesOptions indicesOptions, java.lang.String[] types, java.lang.String routing, java.lang.String searchType, java.lang.Boolean ccsMinimizeRoundtrips, org.elasticsearch.common.xcontent.NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger) throws java.io.IOException
      Throws:
      java.io.IOException
    • writeMultiLineFormat

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

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

      public Task createTask​(long id, java.lang.String type, java.lang.String action, TaskId parentTaskId, java.util.Map<java.lang.String,​java.lang.String> 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