diff --git a/bower.json b/bower.json index 368d64876ab51c..621e43b79c019b 100644 --- a/bower.json +++ b/bower.json @@ -30,7 +30,7 @@ "angular-ui-select": "~0.9.3", "async": "~0.2.10", "bluebird": "~2.1.3", - "bootstrap": "~3.1.1", + "bootstrap": "~3.3.1", "d3": "~3.4.8", "elasticsearch": "elasticsearch/bower-elasticsearch-js#prerelease", "Faker": "~1.1.0", diff --git a/src/kibana/components/agg_table/agg_table.html b/src/kibana/components/agg_table/agg_table.html index bb2c632248d92c..a807370585eca9 100644 --- a/src/kibana/components/agg_table/agg_table.html +++ b/src/kibana/components/agg_table/agg_table.html @@ -5,8 +5,12 @@ per-page="perPage">
diff --git a/src/kibana/components/agg_table/agg_table.js b/src/kibana/components/agg_table/agg_table.js index 3698a925c70db5..24d8af3cc7490c 100644 --- a/src/kibana/components/agg_table/agg_table.js +++ b/src/kibana/components/agg_table/agg_table.js @@ -33,15 +33,14 @@ define(function (require) { quoteValues: config.get('csv:quoteValues') }; - self.exportAsCsv = function () { - var csv = new Blob([self.toCsv()], { type: 'text/plain' }); + self.exportAsCsv = function (formatted) { + var csv = new Blob([self.toCsv(formatted)], { type: 'text/plain' }); self._saveAs(csv, self.csv.filename); }; - - self.toCsv = function () { - var rows = $scope.table.rows; - var columns = $scope.table.columns; + self.toCsv = function (formatted) { + var rows = formatted ? $scope.formattedRows : $scope.table.rows; + var columns = formatted ? $scope.formattedColumns : $scope.table.columns; var nonAlphaNumRE = /[^a-zA-Z0-9]/; var allDoubleQuoteRE = /"/g; diff --git a/src/kibana/components/courier/courier.js b/src/kibana/components/courier/courier.js index 5f7e000d5d413a..b9620555b83473 100644 --- a/src/kibana/components/courier/courier.js +++ b/src/kibana/components/courier/courier.js @@ -7,7 +7,7 @@ define(function (require) { require('components/index_patterns/index_patterns'); require('modules').get('kibana/courier') - .service('courier', function ($rootScope, Private, Promise, indexPatterns) { + .service('courier', function ($rootScope, Private, Promise, indexPatterns, Notifier) { function Courier() { var self = this; @@ -32,7 +32,6 @@ define(function (require) { self.SearchSource = SearchSource; var HastyRefresh = errors.HastyRefresh; - var Abort = errors.Abort; /** * update the time between automatic search requests @@ -50,6 +49,7 @@ define(function (require) { */ self.start = function () { searchLooper.start(); + docLooper.start(); return this; }; @@ -108,10 +108,7 @@ define(function (require) { searchLooper.stop(); docLooper.stop(); - [].concat(requestQueue.splice(0), errorHandlers.splice(0)) - .forEach(function (req) { - req.defer.reject(new Abort()); - }); + _.invoke(requestQueue, 'abort'); if (requestQueue.length) { throw new Error('Aborting all pending requests failed.'); @@ -128,6 +125,10 @@ define(function (require) { self.fetchInterval(0); } }); + + var onFatalDefer = Promise.defer(); + onFatalDefer.promise.then(self.close); + Notifier.fatalCallbacks.push(onFatalDefer.resolve); } return new Courier(); diff --git a/src/kibana/components/courier/fetch/_call_client.js b/src/kibana/components/courier/fetch/_call_client.js index 8c30b5ef9d35ad..4e8b985d691571 100644 --- a/src/kibana/components/courier/fetch/_call_client.js +++ b/src/kibana/components/courier/fetch/_call_client.js @@ -77,6 +77,7 @@ define(function (require) { return (esPromise = es[strategy.clientMethod]({ timeout: configFile.shard_timeout, + ignore_unavailable: true, preference: sessionId, body: body })); diff --git a/src/kibana/components/courier/fetch/_call_response_handlers.js b/src/kibana/components/courier/fetch/_call_response_handlers.js index bf24d74b26ff80..b0ccd164ab7f76 100644 --- a/src/kibana/components/courier/fetch/_call_response_handlers.js +++ b/src/kibana/components/courier/fetch/_call_response_handlers.js @@ -19,8 +19,21 @@ define(function (require) { notify.warning(new SearchTimeout()); } + function progress() { + if (req.isIncomplete()) { + return INCOMPLETE; + } + + req.complete(); + return resp; + } + if (resp.error) { - return req.handleFailure(new RequestFailure(null, resp)); + if (req.filterError(resp)) { + return progress(); + } else { + return req.handleFailure(new RequestFailure(null, resp)); + } } return Promise.try(function () { @@ -30,14 +43,7 @@ define(function (require) { resp = arguments[0]; return req.handleResponse(resp); }) - .then(function () { - if (req.isIncomplete()) { - return INCOMPLETE; - } - - req.complete(); - return resp; - }); + .then(progress); }); } diff --git a/src/kibana/components/courier/fetch/request/doc.js b/src/kibana/components/courier/fetch/request/doc.js index 29cb01df120fa1..6f224e0be3c21f 100644 --- a/src/kibana/components/courier/fetch/request/doc.js +++ b/src/kibana/components/courier/fetch/request/doc.js @@ -2,16 +2,16 @@ define(function (require) { return function DocRequestProvider(Private) { var _ = require('lodash'); - var strategy = Private(require('components/courier/fetch/strategy/doc')); + var docStrategy = Private(require('components/courier/fetch/strategy/doc')); var AbstractRequest = Private(require('components/courier/fetch/request/request')); _(DocRequest).inherits(AbstractRequest); function DocRequest(source, defer) { DocRequest.Super.call(this, source, defer); - } - DocRequest.prototype.type = 'doc'; - DocRequest.prototype.strategy = strategy; + this.type = 'doc'; + this.strategy = docStrategy; + } DocRequest.prototype.canStart = function () { var parent = DocRequest.Super.prototype.canStart.call(this); diff --git a/src/kibana/components/courier/fetch/request/request.js b/src/kibana/components/courier/fetch/request/request.js index 215828837ee86e..2d9cbe32c30de9 100644 --- a/src/kibana/components/courier/fetch/request/request.js +++ b/src/kibana/components/courier/fetch/request/request.js @@ -49,6 +49,10 @@ define(function (require) { return resp; }; + AbstractReq.prototype.filterError = function (resp) { + return false; + }; + AbstractReq.prototype.handleResponse = function (resp) { this.success = true; this.resp = resp; diff --git a/src/kibana/components/courier/fetch/request/segmented.js b/src/kibana/components/courier/fetch/request/segmented.js index a6422418d7297f..02565cacaba571 100644 --- a/src/kibana/components/courier/fetch/request/segmented.js +++ b/src/kibana/components/courier/fetch/request/segmented.js @@ -21,11 +21,19 @@ define(function (require) { this._remainingSize = false; this._direction = 'desc'; this._handle = new SegmentedHandle(this); + // prevent the source from changing between requests + this._getFlattenedSource = _.once(this._getFlattenedSource); // give the request consumer a chance to receive each segment and set // parameters via the handle if (_.isFunction(initFn)) initFn(this._handle); + } + + /********* + ** SearchReq overrides + *********/ + SegmentedReq.prototype.start = function () { this._createQueue(); this._all = this._queue.slice(0); this._complete = []; @@ -41,20 +49,9 @@ define(function (require) { } }; - // prevent the source from changing between requests - this._getFlattenedSource = _.once(this._getFlattenedSource); - - // send out the initial status + // Send the initial fetch status this._reportStatus(); - } - /********* - ** SearchReq overrides - *********/ - - SegmentedReq.prototype.start = function () { - // update the status on every iteration - this._reportStatus(); return SearchReq.prototype.start.call(this); }; @@ -84,6 +81,13 @@ define(function (require) { return this._consumeSegment(resp); }; + SegmentedReq.prototype.filterError = function (resp) { + if (/ClusterBlockException.*index\sclosed/.test(resp.error)) { + this._consumeSegment(false); + return true; + } + }; + SegmentedReq.prototype.isIncomplete = function () { return this._queue.length > 0; }; @@ -136,13 +140,16 @@ define(function (require) { }; SegmentedReq.prototype._consumeSegment = function (seg) { - this._segments.push(seg); var index = this._active; - var first = this._segments.length === 1; + var first = this._segments.length === 0; this._complete.push(index); + if (!seg) return; // segment was ignored/filtered, don't store it + + this._segments.push(seg); + if (this._remainingSize !== false) { this._remainingSize -= seg.hits.hits.length; } diff --git a/src/kibana/components/courier/looper/_looper.js b/src/kibana/components/courier/looper/_looper.js index 6f5eb3d8589f62..b660c5ebc0658a 100644 --- a/src/kibana/components/courier/looper/_looper.js +++ b/src/kibana/components/courier/looper/_looper.js @@ -18,6 +18,9 @@ define(function (require) { */ looper.ms = function (ms) { _ms = ms; + + if (!_started) return; + if (_ms) { looper.restart(); } else { diff --git a/src/kibana/components/courier/looper/doc.js b/src/kibana/components/courier/looper/doc.js index 7090fee4077aa2..5021c36c5a0743 100644 --- a/src/kibana/components/courier/looper/doc.js +++ b/src/kibana/components/courier/looper/doc.js @@ -9,7 +9,7 @@ define(function (require) { */ var docLooper = new Looper(1500, function () { fetch.docs(); - }).start(); + }); return docLooper; }; diff --git a/src/kibana/components/index_patterns/_get_ids.js b/src/kibana/components/index_patterns/_get_ids.js index 757ecdb705679f..3d0b91d4a5c0cd 100644 --- a/src/kibana/components/index_patterns/_get_ids.js +++ b/src/kibana/components/index_patterns/_get_ids.js @@ -20,7 +20,7 @@ define(function (require) { fields: [], body: { query: { match_all: {} }, - size: 10000 + size: 2147483647 } }) .then(function (resp) { diff --git a/src/kibana/components/notify/notify.js b/src/kibana/components/notify/notify.js index 24c609e07b45df..fedcde19e91f7d 100644 --- a/src/kibana/components/notify/notify.js +++ b/src/kibana/components/notify/notify.js @@ -20,16 +20,9 @@ define(function (require) { return Notifier; }); - module.run(function ($timeout, Promise, courier) { + module.run(function ($timeout) { // provide alternate methods for setting timeouts, which will properly trigger digest cycles Notifier.setTimerFns($timeout, $timeout.cancel); - - var onFatalDefer = Promise.defer(); - onFatalDefer.promise.then(function () { - courier.close(); - }); - - Notifier.fatalCallbacks.push(onFatalDefer.resolve); }); /** diff --git a/src/kibana/components/vis/_agg_config.js b/src/kibana/components/vis/_agg_config.js index d0b492a17aa11e..c090014d5ff881 100644 --- a/src/kibana/components/vis/_agg_config.js +++ b/src/kibana/components/vis/_agg_config.js @@ -100,7 +100,8 @@ define(function (require) { * @return {object} the new params object */ AggConfig.prototype.resetParams = function () { - return this.fillDefaults({}); + // We need to ensure that row doesn't get overriden. + return this.fillDefaults(_.pick(this.params, 'row')); }; AggConfig.prototype.write = function () { diff --git a/src/kibana/plugins/dashboard/index.html b/src/kibana/plugins/dashboard/index.html index 03543f689818e6..56d173d341cb64 100644 --- a/src/kibana/plugins/dashboard/index.html +++ b/src/kibana/plugins/dashboard/index.html @@ -1,7 +1,7 @@- 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: -
- - - --
I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is not data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the time picker in the top right corner of your screen. -
-- The search bar at the top allows Kibana uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields. -
- -- -
200- - Or we can search in a specific field. Find 200 in the status field: -
status:200- - Find all status codes between 400-499: -
status:[400 TO 499]- - Find status codes 400-499 with the extension php: -
status:[400 TO 499] AND extension:PHP+
status:[400 TO 499] AND (extension:php OR extension:html)- +
+ 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: +
+ + + ++
I see you are looking at an index with a date field. It is possible your query does not match anything in the current time range, or that there is not data at all in the currently selected time range. Click the button below to open the time picker. For future reference you can open the time picker by clicking the time picker in the top right corner of your screen. +
++ The search bar at the top allows Kibana uses Elasticsearch's support for Lucene Query String syntax. Let's say we're searching web server logs that have been parsed into a few fields. +
+ ++
200+ + Or we can search in a specific field. Find 200 in the status field: +
status:200+ + Find all status codes between 400-499: +
status:[400 TO 499]+ + Find status codes 400-499 with the extension php: +
status:[400 TO 499] AND extension:PHP+ + Or HTML +
status:[400 TO 499] AND (extension:php OR extension:html)+ + +