Skip to content

Commit

Permalink
Fix scripted fields tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Sep 9, 2020
1 parent 32c0184 commit 9ed5a95
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/plugins/discover/public/application/angular/discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,14 @@ function discoverController($element, $route, $scope, $timeout, $window, Promise
$scope.updateDataSource = () => {
const { indexPattern, searchSource } = $scope;
const indexPatternFields = indexPattern.getComputedFields();
const fields = [...$scope.state.columns, ...indexPatternFields.docvalueFields];
const columns = $scope.state.columns.filter((name) => {
return !indexPatternFields.docvalueFields.find((docVal) => docVal.field === name);
});
const fields = [
...columns,
...indexPatternFields.docvalueFields,
...Object.keys(indexPatternFields.scriptFields),
];
searchSource
.setField('index', $scope.indexPattern)
.setField('fields', fields)
Expand Down

0 comments on commit 9ed5a95

Please sign in to comment.