Search + K

Command Palette

Search for a command to run...

Sign In

Get the field capabilities

POST /_field_caps
Copy endpoint

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

Parameters

query Query Parameters

Name Type
allow_no_indices

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 targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

boolean
expand_wildcards

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.

type TypesExpandWildcards = type TypesExpandWildcard = "all" | "open" | "closed" | "hidden" | "none" | type TypesExpandWildcard = "all" | "open" | "closed" | "hidden" | "none"[]
fields

A comma-separated list of fields to retrieve capabilities for. Wildcard (*) expressions are supported.

type TypesFields = type TypesField = string | type TypesField = string[]
ignore_unavailable

If true, missing or closed indices are not included in the response.

boolean
include_unmapped

If true, unmapped fields are included in the response.

boolean
filters

A comma-separated list of filters to apply to the response.

string[] | string
types

A comma-separated list of field types to include. Any fields that do not match one of these types will be excluded from the results. It defaults to empty, meaning that all field types are returned.

string[]
include_empty_fields

If false, empty fields are not included in the response.

boolean

Request Body

application/json
{ fields?: TypesFields
type TypesFields = TypesField | TypesField[]
;index_filter?: TypesQueryDslQueryContainer

An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

interface TypesQueryDslQueryContainer {
bool?: TypesQueryDslBoolQuery;
boosting?: TypesQueryDslBoostingQuery;
common?: { };
combined_fields?: TypesQueryDslCombinedFieldsQuery;
constant_score?: TypesQueryDslConstantScoreQuery;
dis_max?: TypesQueryDslDisMaxQuery;
distance_feature?: TypesQueryDslDistanceFeatureQuery;
exists?: TypesQueryDslExistsQuery;
function_score?: TypesQueryDslFunctionScoreQuery;
fuzzy?: { };
geo_bounding_box?: TypesQueryDslGeoBoundingBoxQuery;
geo_distance?: TypesQueryDslGeoDistanceQuery;
geo_grid?: { };
geo_polygon?: TypesQueryDslGeoPolygonQuery;
geo_shape?: TypesQueryDslGeoShapeQuery;
has_child?: TypesQueryDslHasChildQuery;
has_parent?: TypesQueryDslHasParentQuery;
ids?: TypesQueryDslIdsQuery;
intervals?: { };
knn?: TypesKnnQuery;
match?: { };
match_all?: TypesQueryDslMatchAllQuery;
match_bool_prefix?: { };
match_none?: TypesQueryDslMatchNoneQuery;
match_phrase?: { };
match_phrase_prefix?: { };
more_like_this?: TypesQueryDslMoreLikeThisQuery;
multi_match?: TypesQueryDslMultiMatchQuery;
nested?: TypesQueryDslNestedQuery;
parent_id?: TypesQueryDslParentIdQuery;
percolate?: TypesQueryDslPercolateQuery;
pinned?: TypesQueryDslPinnedQuery;
prefix?: { };
query_string?: TypesQueryDslQueryStringQuery;
range?: { };
rank_feature?: TypesQueryDslRankFeatureQuery;
regexp?: { };
rule?: TypesQueryDslRuleQuery;
script?: TypesQueryDslScriptQuery;
script_score?: TypesQueryDslScriptScoreQuery;
semantic?: TypesQueryDslSemanticQuery;
shape?: TypesQueryDslShapeQuery;
simple_query_string?: TypesQueryDslSimpleQueryStringQuery;
span_containing?: TypesQueryDslSpanContainingQuery;
span_field_masking?: TypesQueryDslSpanFieldMaskingQuery;
span_first?: TypesQueryDslSpanFirstQuery;
span_multi?: TypesQueryDslSpanMultiTermQuery;
span_near?: TypesQueryDslSpanNearQuery;
span_not?: TypesQueryDslSpanNotQuery;
span_or?: TypesQueryDslSpanOrQuery;
span_term?: { };
span_within?: TypesQueryDslSpanWithinQuery;
sparse_vector?: TypesQueryDslSparseVectorQuery;
term?: { };
terms?: TypesQueryDslTermsQuery;
terms_set?: { };
text_expansion?: { };
weighted_tokens?: { };
wildcard?: { };
wrapper?: TypesQueryDslWrapperQuery;
type?: TypesQueryDslTypeQuery;
}
;runtime_mappings?: TypesMappingRuntimeFields
interface TypesMappingRuntimeFields {
[key: string]: TypesMappingRuntimeField;
}
; }

Responses

200 application/json
{ indices: TypesIndices
type TypesIndices = TypesIndexName | TypesIndexName[]
;fields: { }; }