mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
broke out the setting of index/query/etc. on the datasource in discover app.
This commit is contained in:
parent
2d1585c7af
commit
ba6a9474dd
1 changed files with 15 additions and 11 deletions
|
@ -100,17 +100,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);
|
||||
|
@ -118,6 +108,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();
|
||||
};
|
||||
|
@ -212,6 +215,7 @@ define(function (require) {
|
|||
}
|
||||
}
|
||||
|
||||
updateDataSource();
|
||||
$scope.$emit('application.load');
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue