(mappings) Follow kibana index alias when fetching types

This commit is contained in:
Jonathan Budzenski 2016-09-19 13:11:46 -05:00
parent f2c7abecbe
commit cb83c5fa69
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292

View file

@ -32,7 +32,10 @@ define(function () {
// limit the response to just the _source field for each index
fields: '_source'
}).then(function (resp) {
return _.keys(resp[indexName].mappings);
// indexName is not sufficient here, if the kibana indexed is aliased we need to use
// the root index name as key
const index = _.keys(resp)[0];
return _.keys(resp[index].mappings);
});
});