def multi_search(body = nil, params = nil)
      if block_given?
        params, body = (body || {}), nil
        yield msearch_obj = MultiSearch.new(self, params)
        msearch_obj.call
      else
        raise "multi_search request body cannot be nil" if body.nil?
        params ||= {}

        response = self.post "{/index}{/type}/_msearch", params.merge(body: body, action: "msearch", rest_api: "msearch")
        response.body
      end
    end
def multi_search(body = nil, params = nil)
      if block_given?
        params, body = (body || {}), nil
        yield msearch_obj = MultiSearch.new(self, params)
        msearch_obj.call
      else
        raise "multi_search request body cannot be nil" if body.nil?
        params ||= {}

        response = self.post "{/index}{/type}/_msearch", params.merge(body: body, action: "msearch", rest_api: "msearch")
        response.body
      end
    end
Execute an array of searches in bulk. Results are returned in an
 array in the order the queries were sent.

 The `multi_search` method can be used in two ways. Without a block
 the method will perform an API call, and it requires a bulk request
 body and optional request parameters.

 See https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html

 body   - Request body as a String (required if a block is not given)
 params - Optional request parameters as a Hash
 block  - Passed to a MultiSearch instance which assembles the searches
          into a single request.

 Examples

   # index and type in request body
   multi_search(request_body)

   # index in URI
   multi_search(request_body, index: 'default-index')

   # block form
   multi_search(index: 'default-index') do |m|
     m.search({query: {match_all: {}}, size: 0)
     m.search({query: {field: {"foo" => "bar"}}}, type: 'default-type')
     ...
   end

 Returns the response body as a Hash