Skip to content

Aggregation to select top N buckets in a parent multi-bucket aggregation #21135

@veesahni

Description

@veesahni

Describe the feature: Ability to retain only the top N buckets given an aggregated metric on parent buckets. This would be similar to the bucket_selector aggregation (which removes buckets based on a script).

Example: Given a filters aggregation that's provided with 300 filters, we have a sub-aggregation that calculates a metric. We only want the results of buckets having the 5 largest values of the aggregated metric. Today, without a "Top N bucket selector" aggregation, the client has to retrieve all 300 and sort/filter on client side.

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