Skip to content

Commit

Permalink
Merge pull request elastic#8338 from jbudz/issues/7706
Browse files Browse the repository at this point in the history
(mappings) Follow kibana index alias when fetching types
  • Loading branch information
jbudz authored Sep 21, 2016
2 parents 66a0ce3 + 175c3b6 commit a2875d6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/ui/public/utils/mapping_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down

0 comments on commit a2875d6

Please sign in to comment.