ES|QL

class elasticsearch.client.EsqlClient(client)
Parameters:

client (BaseClient)

query(*, query=None, columnar=None, delimiter=None, drop_null_columns=None, error_trace=None, filter=None, filter_path=None, format=None, human=None, locale=None, params=None, pretty=None, profile=None, tables=None, body=None)

Executes an ES|QL request

https://www.elastic.co/guide/en/elasticsearch/reference/8.16/esql-rest.html

Parameters:
  • query (str | None) – The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.

  • columnar (bool | None) – By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.

  • delimiter (str | None) – The character to use between values within a CSV row. Only valid for the CSV format.

  • drop_null_columns (bool | None) – 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.

  • filter (Mapping[str, Any] | None) – Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.

  • format (str | Literal['arrow', 'cbor', 'csv', 'json', 'smile', 'tsv', 'txt', 'yaml'] | None) – A short version of the Accept header, e.g. json, yaml.

  • locale (str | None)

  • params (Sequence[None | bool | float | int | str | Any] | None) – To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.

  • profile (bool | None) – If provided and true the response will include an extra profile object with information on how the query was executed. This information is for human debugging and its format can change at any time but it can give some insight into the performance of each part of the query.

  • tables (Mapping[str, Mapping[str, Mapping[str, Any]]] | None) – Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name.

  • error_trace (bool | None)

  • filter_path (str | Sequence[str] | None)

  • human (bool | None)

  • pretty (bool | None)

  • body (Dict[str, Any] | None)

Return type:

ObjectApiResponse[Any]