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 -
If false, the request returns an error if any wildcard expression, index alias, or
_allvalue targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targetingfoo*,bar*returns an error if an index starts with foo but no index starts with bar. -
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
true, missing or closed indices are not included in the response.
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.