lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-7.6.0 vs lib/elasticsearch/api/actions/exists.rb in elasticsearch-api-7.7.0.pre
- old
+ new
@@ -20,22 +20,25 @@
# @option arguments [List] :_source_includes A list of fields to extract and return from the _source field
# @option arguments [Number] :version Explicit version number for concurrency control
# @option arguments [String] :version_type Specific version type
# (options: internal,external,external_gte,force)
+ # @option arguments [Hash] :headers Custom HTTP headers
#
# *Deprecation notice*:
# Specifying types in urls has been deprecated
# Deprecated since version 7.0.0
#
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-get.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html
#
def exists(arguments = {})
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
+ headers = arguments.delete(:headers) || {}
+
arguments = arguments.clone
_id = arguments.delete(:id)
_index = arguments.delete(:index)
@@ -51,10 +54,10 @@
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
body = nil
Utils.__rescue_from_not_found do
- perform_request(method, path, params, body).status == 200 ? true : false
+ perform_request(method, path, params, body, headers).status == 200 ? true : false
end
end
alias_method :exists?, :exists
# Register this action with its valid params when the module is loaded.