younifyd
Menu

Count search results (GET /_count)

Count search results

GET/_count

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Count search results (GET /_count) action (under search).
  3. Fill in the fields below, then reference the result from later steps as {{countSearchResultsGetCount.response.data}}.

Request

Query parameters

allow_no_indicesboolean

A setting that does two separate checks on the index expression. If `false`, the request returns an error (1) if any wildcard expression (including `_all` and `*`) resolves to zero matching indices or (2) if the complete set of resolved indices, aliases or data streams is empty after all expressions are evaluated. If `true`, index expressions that resolve to no indices are allowed and the request returns an empty result.

analyzerstring

The analyzer to use for the query string. This parameter can be used only when the `q` query string parameter is specified.

analyze_wildcardboolean

If `true`, wildcard and prefix queries are analyzed. This parameter can be used only when the `q` query string parameter is specified.

default_operatorstring

The default operator for query string query: `and` or `or`. This parameter can be used only when the `q` query string parameter is specified.

One ofandANDorOR

dfstring

The field to use as a default when no field prefix is given in the query string. This parameter can be used only when the `q` query string parameter is specified.

expand_wildcardsoneOf

The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. It supports comma-separated values, such as `open,hidden`.

ignore_throttledboolean

If `true`, concrete, expanded, or aliased indices are ignored when frozen.

ignore_unavailableboolean

If `false`, the request returns an error if it targets a concrete (non-wildcarded) index, alias, or data stream that is missing, closed, or otherwise unavailable. If `true`, unavailable concrete targets are silently ignored.

lenientboolean

If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the `q` query string parameter is specified.

min_scorenumber

The minimum `_score` value that documents must have to be included in the result.

preferencestring

The node or shard the operation should be performed on. By default, it is random.

routingoneOf

A custom value used to route operations to a specific shard.

statsoneOf

Specific `tag` of the request for logging and statistical purposes.

terminate_afternumber

The maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.

qstring

The query in Lucene query string syntax. This parameter cannot be used with a request body.

Response

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

countnumber
_shardsany
json
{
  "count": 0,
  "_shards": null
}

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