lib/elasticsearch/api/actions/rank_eval.rb in elasticsearch-api-7.17.11 vs lib/elasticsearch/api/actions/rank_eval.rb in elasticsearch-api-8.0.0.pre1
- old
+ new
@@ -26,40 +26,33 @@
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
# @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch)
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. (*Required*)
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/7.17/search-rank-eval.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/master/search-rank-eval.html
#
def rank_eval(arguments = {})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
headers = arguments.delete(:headers) || {}
+ body = arguments.delete(:body)
+
arguments = arguments.clone
_index = arguments.delete(:index)
method = Elasticsearch::API::HTTP_POST
path = if _index
"#{Utils.__listify(_index)}/_rank_eval"
else
"_rank_eval"
end
- params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
+ params = Utils.process_params(arguments)
- body = arguments[:body]
- perform_request(method, path, params, body, headers).body
+ Elasticsearch::API::Response.new(
+ perform_request(method, path, params, body, headers)
+ )
end
-
- # Register this action with its valid params when the module is loaded.
- #
- # @since 6.2.0
- ParamsRegistry.register(:rank_eval, [
- :ignore_unavailable,
- :allow_no_indices,
- :expand_wildcards,
- :search_type
- ].freeze)
end
end
end