diff --git a/src/kibana/plugins/discover/controllers/discover.js b/src/kibana/plugins/discover/controllers/discover.js index fb125188effa0..7758faff73d2f 100644 --- a/src/kibana/plugins/discover/controllers/discover.js +++ b/src/kibana/plugins/discover/controllers/discover.js @@ -125,6 +125,14 @@ define(function (require) { $scope.fields = null; var init = _.once(function () { + var showTotal = 5; + $scope.failuresShown = showTotal; + $scope.showAllFailures = function () { + $scope.failuresShown = $scope.failures.length; + }; + $scope.showLessFailures = function () { + $scope.failuresShown = showTotal; + }; return $scope.updateDataSource() .then(function () { setFields(); @@ -250,6 +258,7 @@ define(function (require) { function flushResponseData() { $scope.hits = 0; + $scope.faliures = []; $scope.rows = []; $scope.rows.fieldCounts = {}; } @@ -311,6 +320,13 @@ define(function (require) { flushResponseData(); } + if (resp._shards.failed > 0) { + $scope.failures = _.union($scope.failures, resp._shards.failures); + $scope.failures = _.uniq($scope.failures, false, function (failure) { + return failure.index + failure.shard + failure.reason; + }); + } + $scope.hits += resp.hits.total; var rows = $scope.rows; var counts = rows.fieldCounts; diff --git a/src/kibana/plugins/discover/index.html b/src/kibana/plugins/discover/index.html index c5c612a1a6eda..e1c595a9da5f6 100644 --- a/src/kibana/plugins/discover/index.html +++ b/src/kibana/plugins/discover/index.html @@ -66,6 +66,16 @@

No results found

Unfortunately I could not find any results matching your search. I tried really hard. I looked all over the place and frankly, I just couldn't find anything good. Help me, help you. Here's some ideas:

+
+

Shard Failures

+

The following shard failures ocurred:

+ + Show More + Show Less +
+

Expand your time range

diff --git a/src/kibana/plugins/discover/styles/main.less b/src/kibana/plugins/discover/styles/main.less index c7d5cf44dc41d..4813369901e52 100644 --- a/src/kibana/plugins/discover/styles/main.less +++ b/src/kibana/plugins/discover/styles/main.less @@ -33,6 +33,17 @@ } } +.shard-failures { + color: @brand-danger; + background-color: lighten(@brand-danger, 40%) !important; + border: 1px solid @brand-danger; + border-radius: @border-radius-base; + padding: 0 20px 20px; + li { + padding-bottom: 5px; + } +} + .discover-overlay { position: absolute; top: 0;