mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
add upstream's updateDataSource
This commit is contained in:
commit
0d2d503556
1 changed files with 15 additions and 11 deletions
|
@ -110,17 +110,7 @@ define(function (require) {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
$scope.fetch = function () {
|
||||
if (!$scope.fields) getFields();
|
||||
search
|
||||
.size($scope.opts.sampleSize)
|
||||
.query(!$scope.query ? null : {
|
||||
query_string: {
|
||||
query: $scope.query
|
||||
}
|
||||
});
|
||||
|
||||
function updateDataSource() {
|
||||
if ($scope.opts.index !== search.get('index')) {
|
||||
// set the index on the savedSearch
|
||||
search.index($scope.opts.index);
|
||||
|
@ -128,6 +118,19 @@ define(function (require) {
|
|||
$scope.columns = $scope.fields = null;
|
||||
}
|
||||
|
||||
if (!$scope.fields) getFields();
|
||||
|
||||
search
|
||||
.size($scope.opts.sampleSize)
|
||||
.query(!$scope.query ? null : {
|
||||
query_string: {
|
||||
query: $scope.query
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$scope.fetch = function () {
|
||||
updateDataSource();
|
||||
// fetch just this savedSearch
|
||||
search.fetch();
|
||||
};
|
||||
|
@ -222,6 +225,7 @@ define(function (require) {
|
|||
}
|
||||
}
|
||||
|
||||
updateDataSource();
|
||||
$scope.$emit('application.load');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue