Skip to content

Commit

Permalink
Filter out nested fields at the agg param level
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Bargar committed Jan 14, 2020
1 parent 01ca3cc commit 7044931
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/legacy/ui/public/agg_types/param_types/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ export class FieldParamType extends BaseParamType {
const filteredFields = fields.filter((field: Field) => {
const { onlyAggregatable, scriptable, filterFieldTypes } = this;

if ((onlyAggregatable && !field.aggregatable) || (!scriptable && field.scripted)) {
if (
(onlyAggregatable && (!field.aggregatable || field.subType?.nested)) ||
(!scriptable && field.scripted)
) {
return false;
}

Expand Down

0 comments on commit 7044931

Please sign in to comment.