The field capabilities API returns the information about the capabilities of fields among multiple indices Added in 5.4.0
The field capabilities API returns runtime fields like any other field. For example, a runtime field with a type
of keyword is returned 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"}}}'
{
"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"
}
}
}
{
"indices": "string",
"fields": {
"additionalProperty1": {
"additionalProperty1": {
"aggregatable": true,
"indices": "string",
"meta": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"non_aggregatable_indices": "string",
"non_searchable_indices": "string",
"searchable": true,
"type": "string",
"metadata_field": true,
"time_series_dimension": true,
"time_series_metric": "gauge",
"non_dimension_indices": [
"string"
],
"metric_conflicts_indices": [
"string"
]
},
"additionalProperty2": {
"aggregatable": true,
"indices": "string",
"meta": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"non_aggregatable_indices": "string",
"non_searchable_indices": "string",
"searchable": true,
"type": "string",
"metadata_field": true,
"time_series_dimension": true,
"time_series_metric": "gauge",
"non_dimension_indices": [
"string"
],
"metric_conflicts_indices": [
"string"
]
}
},
"additionalProperty2": {
"additionalProperty1": {
"aggregatable": true,
"indices": "string",
"meta": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"non_aggregatable_indices": "string",
"non_searchable_indices": "string",
"searchable": true,
"type": "string",
"metadata_field": true,
"time_series_dimension": true,
"time_series_metric": "gauge",
"non_dimension_indices": [
"string"
],
"metric_conflicts_indices": [
"string"
]
},
"additionalProperty2": {
"aggregatable": true,
"indices": "string",
"meta": {
"additionalProperty1": {},
"additionalProperty2": {}
},
"non_aggregatable_indices": "string",
"non_searchable_indices": "string",
"searchable": true,
"type": "string",
"metadata_field": true,
"time_series_dimension": true,
"time_series_metric": "gauge",
"non_dimension_indices": [
"string"
],
"metric_conflicts_indices": [
"string"
]
}
}
}
}