(mapping) Remove indexName var

This commit is contained in:
Jonathan Budzenski 2016-09-21 09:00:43 -05:00
parent cb83c5fa69
commit 175c3b6bb1
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292

View file

@ -23,16 +23,15 @@ 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) {
// indexName is not sufficient here, if the kibana indexed is aliased we need to use
// 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);