mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Automatically select default index if there is only one (#9707)
Backports PR #9679
**Commit 1:**
Automatically select index if only one
* Original sha: c8fc69fcff
* Authored by Lukas Olson <olson.lukas@gmail.com> on 2016-12-29T18:46:05Z
This commit is contained in:
parent
b2ffc35741
commit
82f883a70e
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