lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-8.12.2 vs lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-8.13.0

- old
+ new

@@ -57,17 +57,16 @@ # @option arguments [Number] :requests_per_second The throttle to set on this request in sub-requests per second. -1 means no throttle. # @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 [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body The search definition using the Query DSL # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.12/docs-update-by-query.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.13/docs-update-by-query.html # def update_by_query(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || "update_by_query" } + request_opts = { endpoint: arguments[:endpoint] || 'update_by_query' } - defined_params = [:index].inject({}) do |set_variables, variable| + defined_params = [:index].each_with_object({}) do |variable, set_variables| 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]