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

- old
+ new

@@ -39,23 +39,27 @@ # dfs_query_then_fetch, dfs_query_and_fetch, count, scan) # # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html # def search_template(arguments={}) - valid_params = [ - :ignore_unavailable, - :allow_no_indices, - :expand_wildcards, - :preference, - :routing, - :scroll, - :search_type ] method = HTTP_GET path = Utils.__pathify( Utils.__listify(arguments[:index]), Utils.__listify(arguments[:type]), '_search/template' ) - params = Utils.__validate_and_extract_params arguments, valid_params + 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(:search_template, [ + :ignore_unavailable, + :allow_no_indices, + :expand_wildcards, + :preference, + :routing, + :scroll, + :search_type ].freeze) end end end