Skip to content

Commit

Permalink
[indexPattern/field] remove "bucketable" property of fields
Browse files Browse the repository at this point in the history
We currently setup a bucketable property on every field in order to detect if the field can be used in a bucket aggregation. When it was discovered that our condition was incorrect we decided that we wanted to lean on Elasticsearch's new strctured error messages rather than trying to maintain a secondary implementation of the validation in Kibana.
  • Loading branch information
spalger committed Jan 4, 2016
1 parent 299964f commit 90b6fe0
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ define(function (require) {
}

if (!field.indexed) {
warnings.push('This field is not indexed and can not be visualized.');
warnings.push('This field is not indexed and might not be usable in visualizations.');
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,11 @@ <h5 ng-show="!field.details.error">Quick Count <kbn-info info="Top 5 values base
</div>
</div>

<a ng-show="field.indexed || field.scripted"
<a
ng-href="{{vizLocation(field)}}"
class="sidebar-item-button primary">
Visualize
<span class="discover-field-vis-warning" ng-show="warnings.length" tooltip="{{warnings.join(' ')}}">
( {{::warnings.length}} <ng-pluralize count="warnings.length" when="{'1':'warning', 'other':'warnings'}"></ng-pluralize> <i aria-hidden="true" class="fa fa-warning"></i> )
</span>
</a>

<div ng-show="!field.indexed && !field.scripted"
disabled="disabled"
tooltip="This field is not indexed thus unavailable for visualization and search"
class="sidebar-item-button primary">Not Indexed</div>
1 change: 0 additions & 1 deletion src/plugins/kibana/public/visualize/editor/agg_params.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ define(function (require) {

if (fieldTypes) {
fields = $filter('fieldType')(fields, fieldTypes);
fields = $filter('filter')(fields, { bucketable: true });
fields = $filter('orderBy')(fields, ['type', 'name']);
}

Expand Down
1 change: 0 additions & 1 deletion src/ui/public/index_patterns/__tests__/_index_pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ describe('index pattern', function () {

describe('fields', function () {
it('should have expected properties on fields', function () {
expect(indexPattern.fields[0]).to.have.property('bucketable');
expect(indexPattern.fields[0]).to.have.property('displayName');
expect(indexPattern.fields[0]).to.have.property('filterable');
expect(indexPattern.fields[0]).to.have.property('format');
Expand Down
2 changes: 0 additions & 2 deletions src/ui/public/index_patterns/_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ define(function (require) {
var indexed = !!spec.indexed;
var scripted = !!spec.scripted;
var sortable = spec.name === '_score' || ((indexed || scripted) && type.sortable);
var bucketable = indexed || scripted;
var filterable = spec.name === '_id' || scripted || (indexed && type.filterable);

obj.fact('name');
Expand All @@ -59,7 +58,6 @@ define(function (require) {
// usage flags, read-only and won't be saved
obj.comp('format', format);
obj.comp('sortable', sortable);
obj.comp('bucketable', bucketable);
obj.comp('filterable', filterable);

// computed values
Expand Down

0 comments on commit 90b6fe0

Please sign in to comment.