mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backport PR #8338
--------- **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:
parent
78500aed29
commit
3287386388
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue