---------

**Commit 1:**
(mappings) Follow kibana index alias when fetching types

* Original sha: cb83c5fa69
* Authored by Jonathan Budzenski <jon@jbudz.me> on 2016-09-19T18:11:46Z

**Commit 2:**
(mapping) Remove indexName var

* Original sha: 175c3b6bb1
* Authored by Jonathan Budzenski <jon@jbudz.me> on 2016-09-21T14:00:43Z
This commit is contained in:
Elastic Jasper 2016-09-21 14:22:11 -04:00
parent 78500aed29
commit 3287386388

View file

@ -23,16 +23,18 @@ define(function () {
* @return {[type]} [description]
*/
let getKnownKibanaTypes = _.once(function () {
let indexName = kbnIndex;
return es.indices.getFieldMapping({
// only concerned with types in this kibana index
index: indexName,
index: kbnIndex,
// check all types
type: '*',
// limit the response to just the _source field for each index
fields: '_source'
}).then(function (resp) {
return _.keys(resp[indexName].mappings);
// kbnIndex 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);
});
});