Field Capabilities API
editField Capabilities API
editThe field capabilities API allows to retrieve the capabilities of fields among multiple indices.
The field capabilities api by default executes on all indices:
GET _field_caps?fields=rating
- but the request can also be restricted to specific indices:
GET twitter/_field_caps?fields=rating
Alternatively the fields
option can also be defined in the request body.
[6.4.0]
Deprecated in 6.4.0. Please use a request parameter instead.
POST _field_caps { "fields" : ["rating"] }
This is equivalent to the previous request.
Supported request options:
|
A list of fields to compute stats for. The field name supports wildcard notation. For example, using |
Field Capabilities
editThe field capabilities api returns the following information per field:
|
Whether this field is indexed for search on all indices. |
|
Whether this field can be aggregated on all indices. |
|
The list of indices where this field has the same type, or null if all indices have the same type for the field. |
|
The list of indices where this field is not searchable, or null if all indices have the same definition for the field. |
|
The list of indices where this field is not aggregatable, or null if all indices have the same definition for the field. |
Response format
editRequest:
GET _field_caps?fields=rating,title
{ "fields": { "rating": { "long": { "searchable": true, "aggregatable": false, "indices": ["index1", "index2"], "non_aggregatable_indices": ["index1"] }, "keyword": { "searchable": false, "aggregatable": true, "indices": ["index3", "index4"], "non_searchable_indices": ["index4"] } }, "title": { "text": { "searchable": true, "aggregatable": false } } } }