lib/elasticsearch/api/actions/termvectors.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/termvectors.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -37,13 +37,21 @@
# @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
# @option arguments [Hash] :body Define parameters and or supply a document to get termvectors for. See documentation.
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-termvectors.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/docs-termvectors.html
#
def termvectors(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "termvectors" }
+
+ 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]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -66,10 +74,10 @@
"#{Utils.__listify(_index)}/_termvectors"
end
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
# Deprecated: Use the plural version, {#termvectors}
#