Skip to content

TopMetricsAggregation provides wrong properties and is missing the "missing" property #4342

Open
@f-loris

Description

@f-loris

🐛 Wrong type

The missing for TopMetricsAggregation is defined per field and not per aggregation. Currently, it is only possible to define the field but no missing property.


see https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-top-metrics#_missing

Besides that, TopMetricsAggregation inherits from MetricAggregationBase which wrongly inherits a missing and script, which are both not available according to https://www.elastic.co/docs/reference/aggregations/search-aggregations-metrics-top-metrics . Note, the missing is wrongly available per aggregation and not per field.

Definition

As a first solution to at least provide support for a proper definition of missing, the TopMetricsValue needs to be extended by missing: FieldValue:

export class TopMetricsValue {
  field: Field
  missing: FieldValue;
}

Changing the inheritance from MetricAggregationBase might have further implications I'm not aware of.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions