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

- old
+ new

@@ -34,13 +34,15 @@ # @option arguments [Number|string] :slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. # @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents) # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The search definition using the Query DSL and the prototype for the index request. (*Required*) # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-reindex.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/docs-reindex.html # def reindex(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || "reindex" } + raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -49,10 +51,10 @@ method = Elasticsearch::API::HTTP_POST path = "_reindex" 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 end end end