Get the field capabilities
- POST also GET /{index}/_field_caps
- POST also GET /_field_caps
Get information about the capabilities of fields among multiple indices.
For data streams, the API returns field capabilities among the stream’s backing indices.
It returns runtime fields like any other field.
For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the keyword family.
Required authorization
- Index privileges view_index_metadata read
Query parameters
-
allow_no_indicesboolean · default: true -
A setting that does two separate checks on the index expression. If
false, the request returns an error (1) if any wildcard expression (including_alland*) 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. Iftrue, index expressions that resolve to no indices are allowed and the request returns an empty result. -
expand_wildcardsstring · default: open -
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. Supports comma-separated values, such as
open,hidden.Supported values include:
all: Match any data stream or index, including hidden ones.open: Match open, non-hidden indices. Also matches any non-hidden data stream.closed: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.hidden: Match hidden data streams and hidden indices. Must be combined withopen,closed, orboth.none: Wildcard expressions are not accepted.
-
Values:
allopenclosedhiddennone -
fieldsoneOf -
A comma-separated list of fields to retrieve capabilities for. Wildcard (
*) expressions are supported. -
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. Iftrue, unavailable concrete targets are silently ignored.
Request body
-
fieldsstring -
A list of fields to retrieve capabilities for. Wildcard (
*) expressions are supported. -
index_filterQuery -
Filter indices if the provided query rewrites to
match_noneon every shard.ImportantThe filtering is done on a best-effort basis, it uses index statistics and mappings to rewrite queries to
match_noneinstead of fully running the request. For instance a range query over a date field can rewrite tomatch_noneif all documents within a shard (including deleted documents) are outside of the provided range. However, not all queries can rewrite tomatch_noneso this API may return an index even if the provided filter matches no document.