Skip to content

Commit

Permalink
Merge pull request #8720 from elastic/jasper/backport/8694/5.x
Browse files Browse the repository at this point in the history
[backport] PR #8694 to 5.x
  • Loading branch information
Matt Bargar authored Oct 17, 2016
2 parents 6619b44 + 6874f1b commit 325d2ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ <h5 ng-show="!field.details.error">Quick Count <kbn-info info="Top 5 values base

<a
ng-href="{{vizLocation(field)}}"
ng-show="field.visualizable"
class="sidebar-item-button primary">
Visualize
<span class="discover-field-vis-warning" ng-show="warnings.length" tooltip="{{warnings.join(' ')}}">
Expand Down
8 changes: 6 additions & 2 deletions src/ui/public/index_patterns/_field.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope
let scripted = !!spec.scripted;
let sortable = spec.name === '_score' || ((indexed || scripted) && type.sortable);
let filterable = spec.name === '_id' || scripted || (indexed && type.filterable);
let searchable = !!spec.searchable || scripted;
let aggregatable = !!spec.aggregatable || scripted;
let visualizable = aggregatable;

obj.fact('name');
obj.fact('type');
Expand All @@ -58,13 +61,14 @@ export default function FieldObjectProvider(Private, shortDotsFilter, $rootScope
obj.fact('doc_values', !!spec.doc_values);

// stats
obj.fact('searchable', !!spec.searchable || scripted);
obj.fact('aggregatable', !!spec.aggregatable || scripted);
obj.fact('searchable', searchable);
obj.fact('aggregatable', aggregatable);

// usage flags, read-only and won't be saved
obj.comp('format', format);
obj.comp('sortable', sortable);
obj.comp('filterable', filterable);
obj.comp('visualizable', visualizable);

// computed values
obj.comp('indexPattern', indexPattern);
Expand Down

0 comments on commit 325d2ec

Please sign in to comment.