Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
e7204be
added source filtering
scampi Jan 12, 2016
b228c66
ditched the new 'retrieved fields' tab and added checkbox to exclude …
scampi Jan 13, 2016
0d06220
disable field exclusion checkbox if field is a metafield
scampi Jan 15, 2016
c3c1d48
[indexPattern] copy excluded field property when refreshing fields
spalger Jan 21, 2016
5b0b00a
[indexPattern/field] move isMetaField consideration into Field
spalger Jan 21, 2016
1dee6f1
[indexPattern/edit] invert the "retreived" column, for accuracy
spalger Jan 21, 2016
ec0c334
[indexPattern/field] touchup the field.exclude message
spalger Jan 21, 2016
062931a
Fix typo
spalger Jan 21, 2016
9d70208
[indexPattern] handle index patterns without fields
spalger Jan 22, 2016
5a97b6b
[courier/searchSource] auto add source filter for index pattern
spalger Jan 23, 2016
8211990
[docTable] remove irrelevant test about source filtering
spalger Feb 12, 2016
fa5b22d
[settings/indices] cleanup imports
spalger Apr 5, 2016
7819fa9
[settings/indexPattern/fields] add "field filters" tab
spalger Apr 5, 2016
d4b9c11
[imports] fix old testUtils import
spalger Apr 5, 2016
d75a63f
[ui/fieldWildcard] add lib to match names based on field-style wildcards
spalger Apr 5, 2016
08f8fd7
[settings/fieldFilters] list filter matches, remove excluded fields f…
spalger Apr 5, 2016
385a062
[fieldWildcard] properly escape regexp control chars
spalger Apr 5, 2016
da62b2a
[settings/indexPatterns] mark fields excluded if they match an exclud…
spalger Apr 5, 2016
e89ceea
[fieldWildcard] properly bind the regexp to the ends
spalger Apr 5, 2016
14d5458
[indexPattern] remove unneeded lodash chain
spalger Apr 6, 2016
dc53a10
[settings/indices] use settings-indices- prefix for tab direcives
spalger Apr 6, 2016
4be31b2
corrected rebase on master
scampi Jun 2, 2016
79e87ca
Do not match exclusion on meta/scripted fields. Disable filter bar wh…
scampi Jun 9, 2016
984d334
Merge branch 'master' into issue4366
scampi Jun 9, 2016
3375fd1
corrected error in merge with _index_pattern
scampi Jun 9, 2016
6a0b331
removed unused code
scampi Jun 9, 2016
81a56f9
Merge branch 'master' into issue4366
scampi Jun 9, 2016
c209ce3
added missing fieldFilters to test dumps
scampi Jun 11, 2016
9511486
Merge branch 'master' into issue4366
scampi Jun 13, 2016
9e32bbc
added the management section refactoring from master
scampi Jun 30, 2016
153051c
corrected merge with master
scampi Jun 30, 2016
deae71c
removed default empty array in the index pattern schema, and check if…
scampi Jul 4, 2016
398f09e
Merge branch 'master' into issue4366
scampi Jul 8, 2016
90894ea
Merge branch 'master' into issue4366
scampi Jul 26, 2016
2f771a8
restricts the source with the exclusion patterns set for that index p…
scampi Jul 26, 2016
39c63be
renamed field filters to source filters and explicitely retrieve the …
scampi Aug 10, 2016
5dfce3d
renamed variables/moved files from field filters to source filters
scampi Aug 14, 2016
5053620
Renamed _field_types.js to _edit_sections.js to better reflect what i…
scampi Aug 14, 2016
3a10394
Removed lines that were specifying the _source field since they were …
scampi Aug 14, 2016
5566013
moved fielddata_fields source filtering to where it is initialized
scampi Aug 14, 2016
5de3906
two-column layout for the source filters indices section
scampi Aug 14, 2016
5b904b0
corrected tests
scampi Aug 14, 2016
5280714
Merge branch 'master' into issue4366
scampi Aug 28, 2016
1d35add
use the same table layout as in the other index sections.
scampi Aug 28, 2016
137667e
Merge branch 'master' into issue4366
scampi Sep 15, 2016
c17d619
Filter out .raw suffix from possible matches.
scampi Sep 15, 2016
4b1f105
Merge branch 'master' of github.com:elastic/kibana into issue4366
scampi Sep 26, 2016
19d58cb
Merge branch 'master' of github.com:elastic/kibana into issue4366
scampi Oct 3, 2016
3e594da
Merge branch 'master' of github.com:elastic/kibana into issue4366
scampi Oct 6, 2016
9256412
exclude is deprecated, should be excludes
scampi Oct 6, 2016
87eb402
improved description
scampi Oct 16, 2016
21fd154
Merge branch 'master' of github.com:elastic/kibana into issue4366
scampi Oct 25, 2016
0979aac
changed as per code review
scampi Oct 25, 2016
5e96240
removed filtering logic for keyword and raw fields
scampi Nov 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core_plugins/kibana/public/doc/controllers/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ app.controller('doc', function ($scope, $route, es, timefilter) {
}
},
stored_fields: computedFields.storedFields,
_source: computedFields._source,
_source: true,
script_fields: computedFields.scriptFields,
docvalue_fields: computedFields.docvalueFields
}
Expand Down
1 change: 1 addition & 0 deletions src/core_plugins/kibana/public/management/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'ui/filters/start_from';
import 'ui/field_editor';
import 'plugins/kibana/management/sections/indices/_indexed_fields';
import 'plugins/kibana/management/sections/indices/_scripted_fields';
import 'plugins/kibana/management/sections/indices/source_filters/source_filters';
import 'ui/directives/bread_crumbs';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,30 @@

<br />

<!-- tab list -->
<ul class="nav nav-tabs">
<li class="kbn-management-tab" ng-class="{ active: state.tab === fieldType.index }" ng-repeat="fieldType in fieldTypes">
<a ng-click="changeTab(fieldType)">
{{ fieldType.title }}
<small>({{ fieldType.count }})</small>
<li class="kbn-management-tab" ng-class="{ active: state.tab === editSection.index }" ng-repeat="editSection in editSections">
<a ng-click="changeTab(editSection)">
{{ editSection.title }}
<small>({{ editSection.count }})</small>
</a>
</li>
</ul>

<indexed-fields ng-show="state.tab == 'indexedFields'" class="fields indexed-fields"></indexed-fields>
<scripted-fields ng-show="state.tab == 'scriptedFields'" class="fields scripted-fields"></scripted-fields>
<!-- tabs -->
<indexed-fields
ng-show="state.tab == 'indexedFields'"
class="fields indexed-fields"
></indexed-fields>
<scripted-fields
ng-show="state.tab == 'scriptedFields'"
class="fields scripted-fields"
></scripted-fields>
<source-filters
ng-show="state.tab == 'sourceFilters'"
index-pattern="indexPattern"
class="fields source-filters"
></source-filters>

</div>
</kbn-management-indices>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import _ from 'lodash';
import 'plugins/kibana/management/sections/indices/_indexed_fields';
import 'plugins/kibana/management/sections/indices/_scripted_fields';
import 'plugins/kibana/management/sections/indices/source_filters/source_filters';
import 'plugins/kibana/management/sections/indices/_index_header';
import RefreshKibanaIndex from 'plugins/kibana/management/sections/indices/_refresh_kibana_index';
import UrlProvider from 'ui/url';
import IndicesFieldTypesProvider from 'plugins/kibana/management/sections/indices/_field_types';
import IndicesEditSectionsProvider from 'plugins/kibana/management/sections/indices/_edit_sections';
import uiRoutes from 'ui/routes';
import uiModules from 'ui/modules';
import editTemplate from 'plugins/kibana/management/sections/indices/_edit.html';
Expand Down Expand Up @@ -51,9 +52,8 @@ uiModules.get('apps/management')
docTitle.change($scope.indexPattern.id);
const otherIds = _.without($route.current.locals.indexPatternIds, $scope.indexPattern.id);

const fieldTypes = Private(IndicesFieldTypesProvider);
$scope.$watch('indexPattern.fields', function () {
$scope.fieldTypes = fieldTypes($scope.indexPattern);
$scope.editSections = Private(IndicesEditSectionsProvider)($scope.indexPattern);
});

$scope.changeTab = function (obj) {
Expand All @@ -62,7 +62,7 @@ uiModules.get('apps/management')
};

$scope.$watch('state.tab', function (tab) {
if (!tab) $scope.changeTab($scope.fieldTypes[0]);
if (!tab) $scope.changeTab($scope.editSections[0]);
});

$scope.$watchCollection('indexPattern.fields', function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import _ from 'lodash';
export default function GetFieldTypes() {

return function (indexPattern) {
const fieldCount = _.countBy(indexPattern.fields, function (field) {
return (field.scripted) ? 'scripted' : 'indexed';
});

_.defaults(fieldCount, {
indexed: 0,
scripted: 0,
sourceFilters: 0
});

return [
{
title: 'fields',
index: 'indexedFields',
count: fieldCount.indexed
},
{
title: 'scripted fields',
index: 'scriptedFields',
count: fieldCount.scripted
},
{
title: 'source filters',
index: 'sourceFilters',
count: fieldCount.sourceFilters
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be using indexPattern.getSourceFilters().length. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
];
};
};

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import nameHtml from 'plugins/kibana/management/sections/indices/_field_name.htm
import typeHtml from 'plugins/kibana/management/sections/indices/_field_type.html';
import controlsHtml from 'plugins/kibana/management/sections/indices/_field_controls.html';
import uiModules from 'ui/modules';
import FieldWildcardProvider from 'ui/field_wildcard';
import indexedFieldsTemplate from 'plugins/kibana/management/sections/indices/_indexed_fields.html';

uiModules.get('apps/management')
.directive('indexedFields', function ($filter) {
.directive('indexedFields', function (Private, $filter) {
const yesTemplate = '<i class="fa fa-check" aria-label="yes"></i>';
const noTemplate = '';
const filter = $filter('filter');
const { fieldWildcardMatcher } = Private(FieldWildcardProvider);

return {
restrict: 'E',
Expand All @@ -26,6 +28,7 @@ uiModules.get('apps/management')
{ title: 'searchable', info: 'These fields can be used in the filter bar' },
{ title: 'aggregatable' , info: 'These fields can be used in visualization aggregations' },
{ title: 'analyzed', info: 'Analyzed fields may require extra memory to visualize' },
{ title: 'excluded', info: 'Fields that are excluded from _source when it is fetched' },
{ title: 'controls', sortable: false }
];

Expand All @@ -34,14 +37,17 @@ uiModules.get('apps/management')
function refreshRows() {
// clear and destroy row scopes
_.invoke(rowScopes.splice(0), '$destroy');

const fields = filter($scope.indexPattern.getNonScriptedFields(), $scope.fieldFilter);
_.find($scope.fieldTypes, {index: 'indexedFields'}).count = fields.length; // Update the tab count
const sourceFilters = $scope.indexPattern.sourceFilters && $scope.indexPattern.sourceFilters.map(f => f.value) || [];
const fieldWildcardMatch = fieldWildcardMatcher(sourceFilters);
_.find($scope.editSections, {index: 'indexedFields'}).count = fields.length; // Update the tab count

$scope.rows = fields.map(function (field) {
const childScope = _.assign($scope.$new(), { field: field });
rowScopes.push(childScope);

const excluded = fieldWildcardMatch(field.name);

return [
{
markup: nameHtml,
Expand Down Expand Up @@ -69,6 +75,10 @@ uiModules.get('apps/management')
markup: field.analyzed ? yesTemplate : noTemplate,
value: field.analyzed
},
{
markup: excluded ? yesTemplate : noTemplate,
value: excluded
},
{
markup: controlsHtml,
scope: childScope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ uiModules.get('apps/management')
rowScopes.length = 0;

const fields = filter($scope.indexPattern.getScriptedFields(), $scope.fieldFilter);
_.find($scope.fieldTypes, {index: 'scriptedFields'}).count = fields.length; // Update the tab count
_.find($scope.editSections, {index: 'scriptedFields'}).count = fields.length; // Update the tab count

$scope.rows = fields.map(function (field) {
const rowScope = $scope.$new();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="actions">
<button
aria-label="Edit source filter"
ng-if="sourceFilters.editing !== filter"
ng-click="sourceFilters.editing = filter"
type="button"
class="btn btn-xs btn-default">
<i aria-hidden="true" class="fa fa-pencil"></i>
</button>
<button
aria-label="Save source filter"
ng-if="sourceFilters.editing === filter"
ng-click="sourceFilters.save()"
ng-disabled="!filter.value"
type="button"
class="btn btn-xs btn-primary">
<i aria-hidden="true" class="fa fa-save"></i>
</button>
<button
aria-label="Delete source filter"
ng-click="sourceFilters.delete(filter)"
type="button"
class="btn btn-xs btn-danger">
<i aria-hidden="true" class="fa fa-trash"></i>
</button>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="value">
<span ng-if="sourceFilters.editing !== filter">{{ filter.value }}</span>

<input
ng-model="filter.value"
input-focus
ng-if="sourceFilters.editing === filter"
placeholder="{{ sourceFilters.placeHolder }}"
type="text"
required
class="form-control">
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<h3>Source Filters</h3>

<p>
Source filters can be used to exclude one or more fields when fetching the document source. This happens when viewing a document in the Discover app, or with a table displaying results from a saved search in the Dashboard app. Each row is built using the source of a single document, and if you have documents with large or unimportant fields you may benefit from filtering those out at this lower level.
</p>

<p>
Note that multi-fields will incorrectly appear as matches in the table below. These filters only actually apply to fields in the original source document, so matching multi-fields are not actually being filtered.
</p>

<div ng-class="{ saving: sourceFilters.saving }" class="source-filters-container">

<form name="form" ng-submit="sourceFilters.create()">
<div class="input-group">
<input
ng-model="sourceFilters.newValue"
placeholder="{{ sourceFilters.placeHolder }}"
type="text"
class="form-control">

<div class="input-group-btn" role="group" aria-label="Source Filter Editor Controls">
<button
type="submit"
class="btn btn-primary"
ng-disabled="!sourceFilters.newValue">
Add
</button>
</div>
</div>
</form>

<paginated-table
columns="columns"
rows="rows"
per-page="perPage">
</paginated-table>
</div>
Loading