younifyd
Menu

Count (POST /{index}/_count)

Count

POST/{index}/_count

Use it in a workflow

  1. Add a step and choose the OpenSearch connector.
  2. Pick the Count (POST /{index}/_count) action (under core).
  3. Fill in the fields below, then reference the result from later steps as {{countPostIndexCount.response.data}}.

Request

Path parameters

indexoneOfrequired

A comma-separated list of data streams, indexes, and aliases to search. Supports wildcards (`*`). To search all data streams and indexes, omit this parameter or use `*` or `_all`.

Query parameters

allow_no_indicesboolean

If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indexes. This behavior applies even if the request targets other open indexes.

analyze_wildcardboolean

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

Default false

analyzerstring

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

default_operatorstring

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

dfstring

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

expand_wildcardsoneOf

Specifies the type of index that wildcard expressions can match. Supports comma-separated values.

ignore_throttledboolean

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

ignore_unavailableboolean

If `false`, the request returns an error if it targets a missing or closed index.

lenientboolean

If `true`, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.

min_scorenumber (float)

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

preferencestring

Specifies the node or shard the operation should be performed on. Random by default.

Default "random"

qstring

Query in the Lucene query string syntax.

routingoneOf

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

terminate_afterinteger (int32)

Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting.

prettyboolean

Whether to pretty-format the returned JSON response.

Default false

humanboolean

Whether to return human-readable values for statistics.

Default false

error_traceboolean

Whether to include the stack trace of returned errors.

Default false

sourcestring

The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

filter_pathoneOf

A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.

Response

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

terminated_earlyboolean
countinteger (int64)
_shardsobject
failedintegerrequired
successfulintegerrequired
totalintegerrequired
failuresarray<object>4 fields
skippedinteger
json
{
  "count": 0,
  "_shards": {
    "failed": 0,
    "successful": 0,
    "total": 0,
    "failures": [
      {
        "shard": 0,
        "reason": {
          "type": "string",
          "reason": "string",
          "stack_trace": "string",
          "caused_by": {},
          "root_cause": [
            {}
          ],
          "suppressed": [
            {}
          ],
          "header": {}
        },
        "index": "string",
        "node": "string"
      }
    ],
    "skipped": 0
  },
  "terminated_early": false
}

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