Skip to content

Remove buckets_path from Bucket Selector Aggregation and Expose Buckets to Script? #32189

@original-brownbear

Description

@original-brownbear

This is coming from #32068 (comment)

Quote @rjernst :


Putting the bucket accessors inside params is how we currently do this, but I don't think it is how we should do this long term. Params should be solely for user provided params (they should be read only, since they are parsed once and should be the same across all documents). Can you please open an issue to discuss with the search/aggs team how these buckets should be accessible in the future? With contexts we could potentially not use buckets_path at all, and have a buckets variable available in the script. eg:

Current:

"bucket_selector": {
    "buckets_path": {
        "foobar": "foo>bar"
      },
      "script": "params.foobar > 200"
}

Potential new script use:

"bucket_selector": {
    "script": "buckets['foo']['bar'].value > 200"
}

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