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 @@