mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Automatically select index if only one (#9679)
This commit is contained in:
parent
78dd094c5e
commit
b4d754a578
1 changed files with 7 additions and 1 deletions
|
@ -31,7 +31,13 @@ module.exports = function (opts) {
|
|||
}
|
||||
|
||||
if (!defined && route.requireDefaultIndex) {
|
||||
throw new NoDefaultIndexPattern();
|
||||
// If there is only one index pattern, set it as default
|
||||
if (patterns.length === 1) {
|
||||
defaultId = patterns[0];
|
||||
config.set('defaultIndex', defaultId);
|
||||
} else {
|
||||
throw new NoDefaultIndexPattern();
|
||||
}
|
||||
}
|
||||
|
||||
return notify.event('loading default index pattern', function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue