-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Currently, the _field_caps API presents a transparent view of fields where aliases and multi-fields are not linked. However for some applications it is important to be able to retrieve the source field that was used to populate a specific field since the value of a sub-field (inside a multi-field) or an alias is not present in the _source. For this reason we have some duplicated logic in ml and sql that tries to infer the source path using some fragile heuristics. In order to simplify this retrieval this issue is a proposal to add a source_path section to the fields inside the field_caps response. This way it would be easy for consumers of this API to redirect some fields to their source path when values need to be retrieved:
{
"indices" : [ "index1", "index2" ],
"fields" : {
"alias_field" : {
"keyword" : {
"type" : "keyword",
"searchable" : true,
"aggregatable" : true,
"source_path": "concrete_field"
}
},
"some_field.multi_field" : {
"keyword" : {
"type" : "keyword",
"searchable" : true,
"aggregatable" : true,
"source_path": "some_field"
}
}
}
}
This information should be easy to add for alias field and sub-fields inside a multi-field. It might be more problematic for copy_to since the target could have multiple source.