lib/elasticsearch/api/actions/sql/query.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/sql/query.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -26,13 +26,15 @@
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Hash] :headers Custom HTTP headers
# @option arguments [Hash] :body Use the `query` element to start a query. Use the `cursor` element to continue a query. (*Required*)
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/sql-search-api.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/sql-search-api.html
#
def query(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "sql.query" }
+
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -41,10 +43,10 @@
method = Elasticsearch::API::HTTP_POST
path = "_sql"
params = Utils.process_params(arguments)
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end