lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-7.6.0 vs lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-7.7.0.pre

- old
+ new

@@ -21,11 +21,11 @@ # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) # @option arguments [String] :conflicts What to do when the update by query hits version conflicts? # (options: abort,proceed) # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. - # (options: open,closed,none,all) + # (options: open,closed,hidden,none,all) # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored # @option arguments [String] :pipeline Ingest pipeline to set on index requests made by this action. (default: none) # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) # @option arguments [String] :q Query in the Lucene query string syntax @@ -50,24 +50,26 @@ # @option arguments [Time] :timeout Time each individual bulk request should wait for shards that are unavailable. # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) # @option arguments [Number] :scroll_size Size on the scroll request powering the update by query # @option arguments [Boolean] :wait_for_completion Should the request should block until the update by query operation is complete. # @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] :slices The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks. - + # @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 # # *Deprecation notice*: # Specifying types in urls has been deprecated # Deprecated since version 7.0.0 # # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docs-update-by-query.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-update-by-query.html # def update_by_query(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] + headers = arguments.delete(:headers) || {} + arguments = arguments.clone _index = arguments.delete(:index) _type = arguments.delete(:type) @@ -79,10 +81,10 @@ "#{Utils.__listify(_index)}/_update_by_query" end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] - perform_request(method, path, params, body).body + perform_request(method, path, params, body, headers).body end # Register this action with its valid params when the module is loaded. # # @since 6.2.0