mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[discover] pass field counts to field chooser
This commit is contained in:
parent
a8f8eaaea4
commit
4b2f3a0cce
3 changed files with 5 additions and 3 deletions
|
@ -17,6 +17,7 @@ define(function (require) {
|
|||
scope: {
|
||||
columns: '=',
|
||||
data: '=',
|
||||
fieldCounts: '=',
|
||||
state: '=',
|
||||
indexPattern: '=',
|
||||
indexPatternList: '=',
|
||||
|
|
|
@ -347,7 +347,6 @@ define(function (require) {
|
|||
}
|
||||
|
||||
var rows = $scope.rows;
|
||||
var counts = $scope.fieldCounts || ($scope.fieldCounts = {});
|
||||
var indexPattern = $scope.searchSource.get('index');
|
||||
|
||||
// merge the rows and the hits, use a new array to help watchers
|
||||
|
@ -357,11 +356,12 @@ define(function (require) {
|
|||
notify.event('resort rows', function () {
|
||||
rows.sort(sortFn);
|
||||
rows = $scope.rows = rows.slice(0, totalSize);
|
||||
counts = $scope.fieldCounts = {};
|
||||
$scope.fieldCounts = {};
|
||||
});
|
||||
}
|
||||
|
||||
notify.event('flatten hit and count fields', function () {
|
||||
var counts = $scope.fieldCounts;
|
||||
$scope.rows.forEach(function (hit) {
|
||||
// skip this work if we have already done it and we are NOT sorting.
|
||||
// ---
|
||||
|
|
|
@ -64,7 +64,8 @@
|
|||
<disc-field-chooser
|
||||
columns="state.columns"
|
||||
refresh="refreshFieldList"
|
||||
data="rows"
|
||||
rows="rows"
|
||||
field-counts="fieldCounts"
|
||||
filter="filterQuery"
|
||||
index-pattern="searchSource.get('index')"
|
||||
index-pattern-list="opts.indexPatternList"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue