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

- old
+ new

@@ -58,40 +58,42 @@ # @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/docs-termvectors.html # def termvectors(arguments={}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] raise ArgumentError, "Required argument 'type' missing" unless arguments[:type] - - valid_params = [ - :term_statistics, - :field_statistics, - :fields, - :offsets, - :positions, - :payloads, - :preference, - :realtime, - :routing, - :parent ] - method = HTTP_GET endpoint = arguments.delete(:endpoint) || '_termvectors' path = Utils.__pathify Utils.__escape(arguments[:index]), Utils.__escape(arguments[:type]), arguments[:id], endpoint - 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 # @deprecated Use the plural version, {#termvectors} # def termvector(arguments={}) termvectors(arguments.merge :endpoint => '_termvector') end + + # Register this action with its valid params when the module is loaded. + # + # @since 6.2.0 + ParamsRegistry.register(:termvectors, [ + :term_statistics, + :field_statistics, + :fields, + :offsets, + :positions, + :payloads, + :preference, + :realtime, + :routing, + :parent ].freeze) end end end