lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-7.6.0 vs lib/elasticsearch/api/actions/clear_scroll.rb in elasticsearch-api-7.7.0.pre
- old
+ new
@@ -6,34 +6,36 @@
module API
module Actions
# Explicitly clears the search context for a scroll.
#
# @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear *Deprecated*
-
+ # @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter
#
# *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/7.5/search-request-body.html#_clear_scroll_api
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-body.html#_clear_scroll_api
#
def clear_scroll(arguments = {})
+ headers = arguments.delete(:headers) || {}
+
arguments = arguments.clone
_scroll_id = arguments.delete(:scroll_id)
method = Elasticsearch::API::HTTP_DELETE
path = if _scroll_id
"_search/scroll/#{Utils.__listify(_scroll_id)}"
else
"_search/scroll"
-end
+ end
params = {}
body = arguments[:body]
- perform_request(method, path, params, body).body
+ perform_request(method, path, params, body, headers).body
end
end
end
end