Get the field capabilities Added in 5.4.0
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.
Query parameters
-
allow_no_indices boolean
If false, the request returns an error if any wildcard expression, index alias, or
_all
value 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_wildcards string | array[string]
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
. -
fields string | array[string]
Comma-separated list of fields to retrieve capabilities for. Wildcard (
*
) expressions are supported. -
include_unmapped boolean
If true, unmapped fields are included in the response.
-
filters string
An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent
-
types array[string]
Only return results for fields that have one of the types in the list
-
include_empty_fields boolean
If false, empty fields are not included in the response.
Body
-
fields string | array[string]
-
index_filter object
Additional properties are allowed.
-
runtime_mappings object
curl \
-X GET http://api.example.com/_field_caps \
-H "Content-Type: application/json" \
-d '{"fields":"string","index_filter":{},"runtime_mappings":{"additionalProperty1":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"},"additionalProperty2":{"fields":{"additionalProperty1":{"type":"boolean"},"additionalProperty2":{"type":"boolean"}},"fetch_fields":[{"field":"string","format":"string"}],"format":"string","input_field":"string","target_field":"string","target_index":"string","script":{"source":"string","id":"string","params":{"additionalProperty1":{},"additionalProperty2":{}},"":"painless","options":{"additionalProperty1":"string","additionalProperty2":"string"}},"type":"boolean"}}}'