Module: ElasticsearchServerless::API::Esql::Actions

Defined in:
lib/elasticsearch-serverless/api/esql/query.rb

Instance Method Summary collapse

Instance Method Details

#query(arguments = {}) ⇒ Object

Executes an ES|QL request This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :format (String)

    A short version of the Accept header, e.g. json, yaml.

  • :delimiter (String)

    The character to use between values within a CSV row. Only valid for the CSV format.

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    request body

Raises:

  • (ArgumentError)

See Also:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/elasticsearch-serverless/api/esql/query.rb', line 38

def query(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body = arguments.delete(:body)

  method = ElasticsearchServerless::API::HTTP_POST
  path   = "_query"
  params = Utils.process_params(arguments)

  ElasticsearchServerless::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end