younifyd
Menu

Get async SQL search results

Get async SQL search results

GET/_sql/async/{id}

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Get async SQL search results action (under sql).
  3. Fill in the fields below, then reference the result from later steps as {{getAsyncSqlSearchResults.response.data}}.

Request

Path parameters

idstringrequired

The identifier for the search.

Query parameters

delimiterstring

The separator for CSV results. The API supports this parameter only for CSV responses.

formatstring

The format for the response. You must specify a format using this parameter or the `Accept` HTTP header. If you specify both, the API uses this parameter.

keep_aliveoneOf

The retention period for the search and its results. It defaults to the `keep_alive` period for the original SQL search.

wait_for_completion_timeoutoneOf

The period to wait for complete results. It defaults to no timeout, meaning the request waits for complete search results.

Response

Returns 200 with an object. Read it in later steps with {{getAsyncSqlSearchResults.response.data.<field>}}.

idany

Identifier for the search. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in the `Async-ID` HTTP header.

is_runningboolean

If `true`, the search is still running. If `false`, the search has finished. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.

is_partialboolean

If `true`, the response does not contain complete search results. If `is_partial` is `true` and `is_running` is `true`, the search is still running. If `is_partial` is `true` but `is_running` is `false`, the results are partial due to a failure or timeout. This value is returned only for async and saved synchronous searches. For CSV, TSV, and TXT responses, this value is returned in the `Async-partial` HTTP header.

columnsarray<object>

Column headings for the search results. Each object is a column.

nameanyrequired
typestringrequired
cursorstring

The cursor for the next set of paginated results. For CSV, TSV, and TXT responses, this value is returned in the `Cursor` HTTP header.

rowsarray<array<object>>

The values for the search results.

json
{
  "id": null,
  "is_running": false,
  "is_partial": false,
  "rows": [
    [
      {}
    ]
  ],
  "columns": [
    {
      "name": null,
      "type": "string"
    }
  ],
  "cursor": "string"
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.