lib/elasticsearch/api/actions/termvectors.rb in elasticsearch-api-7.13.3 vs lib/elasticsearch/api/actions/termvectors.rb in elasticsearch-api-7.14.0.pre

- old
+ new

@@ -40,11 +40,11 @@ # *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.13/docs-termvectors.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.14/docs-termvectors.html # def termvectors(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} @@ -62,19 +62,19 @@ else Elasticsearch::API::HTTP_GET end endpoint = arguments.delete(:endpoint) || '_termvectors' - path = if _index && _type && _id - "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/#{endpoint}" - elsif _index && _type - "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{endpoint}" - elsif _index && _id - "#{Utils.__listify(_index)}/#{endpoint}/#{Utils.__listify(_id)}" - else - "#{Utils.__listify(_index)}/#{endpoint}" - end + path = if _index && _type && _id + "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{Utils.__listify(_id)}/#{endpoint}" + elsif _index && _type + "#{Utils.__listify(_index)}/#{Utils.__listify(_type)}/#{endpoint}" + elsif _index && _id + "#{Utils.__listify(_index)}/#{endpoint}/#{Utils.__listify(_id)}" + else + "#{Utils.__listify(_index)}/#{endpoint}" + end params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body, headers).body @@ -83,9 +83,10 @@ # 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,