Module: Elasticsearch::API::Esql::Actions
- Included in:
- EsqlClient
- Defined in:
- lib/elasticsearch/api/namespace/esql.rb,
lib/elasticsearch/api/actions/esql/query.rb,
lib/elasticsearch/api/actions/esql/async_query.rb,
lib/elasticsearch/api/actions/esql/async_query_get.rb
Instance Method Summary collapse
-
#async_query(arguments = {}) ⇒ Object
Executes an ESQL request asynchronously.
-
#async_query_get(arguments = {}) ⇒ Object
Retrieves the results of a previously submitted async query request given its ID.
-
#query(arguments = {}) ⇒ Object
Executes an ESQL request.
Instance Method Details
#async_query(arguments = {}) ⇒ Object
Executes an ESQL request asynchronously
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/elasticsearch/api/actions/esql/async_query.rb', line 35 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 |
#async_query_get(arguments = {}) ⇒ Object
Retrieves the results of a previously submitted async query request given its ID.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/api/actions/esql/async_query_get.rb', line 35 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 |
#query(arguments = {}) ⇒ Object
Executes an ESQL request
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/elasticsearch/api/actions/esql/query.rb', line 35 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 |