lib/elasticsearch/api/actions/exists_source.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/exists_source.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -34,13 +34,21 @@
# @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)
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-get.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/docs-get.html
#
def exists_source(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "exists_source" }
+
+ defined_params = [:index, :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 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -54,10 +62,10 @@
method = Elasticsearch::API::HTTP_HEAD
path = "#{Utils.__listify(_index)}/_source/#{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
alias_method :exists_source?, :exists_source
end