lib/elasticsearch/api/actions/async_search/get.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/async_search/get.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -28,13 +28,21 @@
# @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response
# @option arguments [Time] :keep_alive Specify the time interval in which the results (partial or final) for this search will be available
# @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/async-search.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/async-search.html
#
def get(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "async_search.get" }
+
+ defined_params = [:id].inject({}) do |set_variables, variable|
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
+ set_variables
+ end
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
+
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -45,10 +53,10 @@
method = Elasticsearch::API::HTTP_GET
path = "_async_search/#{Utils.__listify(_id)}"
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end