Open
Description
When setting types
query parameter in a field_caps requests we want returned only fields with the specified types, but instead we also get objects
fields if an object has at least a child of type one of the specified types
.
A workaround to avoid this is to set filters=-parent
excluding all the parents objects from the response.
Should this API instead exclude non specified types from the response by default?
Example:
GET index-1/_field_caps?fields=*&types=keyword
{
"indices": [
"index-1"
],
"fields": {
"products": {
"object": {
"type": "object",
"metadata_field": false,
"searchable": false,
"aggregatable": false
}
},
"products._id.keyword": {
"keyword": {
"type": "keyword",
"metadata_field": false,
"searchable": true,
"aggregatable": true
}
},
"manufacturer": {
"keyword": {
"type": "keyword",
"metadata_field": false,
"searchable": true,
"aggregatable": true
}
},
...
}
}