module Elasticsearch::API::Esql::Actions
Public Instance Methods
Source
# File lib/elasticsearch/api/actions/esql/async_query.rb, line 49 def async_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_query/async' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Run an async ES|QL query. Asynchronously run an ES|QL (Elasticsearch
query language) query, monitor its progress, and retrieve results when they become available. The API
accepts the same parameters and request body as the synchronous query API
, along with additional async related properties.
@option arguments [String] :delimiter The character to use between values within a CSV row.
It is valid only for the CSV format.
@option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely null
will be removed from the columns
and values
portion of the results.
If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns.
@option arguments [String] :format A short version of the Accept header, for example json
or yaml
. @option arguments [Time] :keep_alive The period for which the query and its results are stored in the cluster.
The default period is five days. When this period expires, the query and its results are deleted, even if the query is still ongoing. If the +keep_on_completion+ parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the +wait_for_completion_timeout+ parameter, regardless of this value. Server default: 5d.
@option arguments [Boolean] :keep_on_completion Indicates whether the query and its results are stored in the cluster.
If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the +wait_for_completion_timeout+ parameter.
@option arguments [Time] :wait_for_completion_timeout The period to wait for the request to finish.
By default, the request waits for 1 second for the query results. If the query completes during this period, results are returned Otherwise, a query ID is returned that can later be used to retrieve the results. Server default: 1s.
@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body request body
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query
Source
# File lib/elasticsearch/api/actions/esql/async_query_delete.rb, line 39 def async_query_delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_delete' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE path = "_query/async/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Delete an async ES|QL query. If the query is still running, it is cancelled. Otherwise, the stored results are deleted. If the Elasticsearch
security features are enabled, only the following users can use this API
to delete a query:
-
The authenticated user that submitted the original query request
-
Users with the
cancel_task
cluster privilege
@option arguments [String] :id The unique identifier of the query.
A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*)
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-delete
Source
# File lib/elasticsearch/api/actions/esql/async_query_get.rb, line 44 def async_query_get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_get' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = "_query/async/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Get async ES|QL query results. Get the current status and available results or stored results for an ES|QL asynchronous query. If the Elasticsearch
security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API
.
@option arguments [String] :id The unique identifier of the query.
A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*)
@option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely null
will be removed from the columns
and values
portion of the results.
If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns.
@option arguments [Time] :keep_alive The period for which the query and its results are stored in the cluster.
When this period expires, the query and its results are deleted, even if the query is still ongoing.
@option arguments [Time] :wait_for_completion_timeout The period to wait for the request to finish.
By default, the request waits for complete query results. If the request completes during the period specified in this parameter, complete query results are returned. Otherwise, the response returns an +is_running+ value of +true+ and no results.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-get
Source
# File lib/elasticsearch/api/actions/esql/async_query_stop.rb, line 38 def async_query_stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_stop' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST path = "_query/async/#{Utils.listify(_id)}/stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Stop async ES|QL query. This API
interrupts the query execution and returns the results so far. If the Elasticsearch
security features are enabled, only the user who first submitted the ES|QL query can stop it.
@option arguments [String] :id The unique identifier of the query.
A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*)
@option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely null
will be removed from the columns
and values
portion of the results.
If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns.
@option arguments [Hash] :headers Custom HTTP headers
@see www.elastic.co/docs/api/doc/elasticsearch/v9/operation/operation-esql-async-query-stop
Source
# File lib/elasticsearch/api/actions/esql/query.rb, line 40 def query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.query' } raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_query' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end
Run an ES|QL query. Get search results for an ES|QL (Elasticsearch
query language) query. This functionality is subject to potential breaking changes within a minor version, meaning that your referencing code may break when this library is upgraded.
@option arguments [String] :format A short version of the Accept header, e.g. json, yaml. @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the CSV format. @option arguments [Boolean] :drop_null_columns Should columns that are entirely null
be removed from the columns
and values
portion of the results?
Defaults to +false+. If +true+ then the response will include an extra section under the name +all_columns+ which has the name of all columns.
@option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body request body
@see www.elastic.co/docs/explore-analyze/query-filter/languages/esql-rest