lib/elasticsearch/api/actions/reindex.rb in elasticsearch-api-7.17.11 vs lib/elasticsearch/api/actions/reindex.rb in elasticsearch-api-8.0.0.pre1
- old
+ new
@@ -31,38 +31,27 @@
# @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/7.17/docs-reindex.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-reindex.html
#
def reindex(arguments = {})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
headers = arguments.delete(:headers) || {}
+ body = arguments.delete(:body)
+
arguments = arguments.clone
method = Elasticsearch::API::HTTP_POST
path = "_reindex"
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
+ params = Utils.process_params(arguments)
- body = arguments[:body]
- perform_request(method, path, params, body, headers).body
+ Elasticsearch::API::Response.new(
+ perform_request(method, path, params, body, headers)
+ )
end
-
- # Register this action with its valid params when the module is loaded.
- #
- # @since 6.2.0
- ParamsRegistry.register(:reindex, [
- :refresh,
- :timeout,
- :wait_for_active_shards,
- :wait_for_completion,
- :requests_per_second,
- :scroll,
- :slices,
- :max_docs
- ].freeze)
end
end
end