lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-6.1.0 vs lib/elasticsearch/api/actions/update_by_query.rb in elasticsearch-api-6.2.0

- old
+ new

@@ -65,12 +65,27 @@ # # @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] + method = HTTP_POST - valid_params = [ + path = Utils.__pathify Utils.__listify(arguments[:index]), + Utils.__listify(arguments[:type]), + '/_update_by_query' + + params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) + + body = arguments[:body] + + perform_request(method, path, params, body).body + end + + # Register this action with its valid params when the module is loaded. + # + # @since 6.2.0 + ParamsRegistry.register(:update_by_query, [ :analyzer, :analyze_wildcard, :default_operator, :df, :explain, @@ -92,11 +107,13 @@ :search_timeout, :size, :sort, :_source, :_source_exclude, + :_source_excludes, :_source_include, + :_source_includes, :terminate_after, :stats, :suggest_field, :suggest_mode, :suggest_size, @@ -109,22 +126,9 @@ :refresh, :consistency, :scroll_size, :wait_for_completion, :requests_per_second, - :slices ] - - method = HTTP_POST - - path = Utils.__pathify Utils.__listify(arguments[:index]), - Utils.__listify(arguments[:type]), - '/_update_by_query' - - params = Utils.__validate_and_extract_params arguments, valid_params - - body = arguments[:body] - - perform_request(method, path, params, body).body - end + :slices ].freeze) end end end