lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-8.11.0

- old
+ new

@@ -30,13 +30,21 @@ # *Deprecation notice*: # A scroll id can be quite large and should be specified as part of the body # Deprecated since version 7.0.0 # # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/clear-scroll-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/clear-scroll-api.html # def clear_scroll(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || "clear_scroll" } + + defined_params = [:scroll_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? + arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) @@ -51,15 +59,15 @@ params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) Utils.__rescue_from_not_found { Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers) + perform_request(method, path, params, body, headers, request_opts) ) } else Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers) + perform_request(method, path, params, body, headers, request_opts) ) end end end end