-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove buckets_path from Bucket Selector Aggregation and Expose Buckets to Script? #32189
Comments
Pinging @elastic/es-search-aggs |
We chatted about this a bit in the S&A meeting, forgot to update the ticket. Sorry about that! @original-brownbear @rjernst We liked the syntax. It does introduce a bit of inconsistency with the other pipeline aggs since they will still need a @colings86 did think of a potential, technical issue though. In addition to providing values to the script, we use From our conversations, it sounds like painless would want to resolve these values lazily (e.g. when the script is actually executing) which would complicate the execution order issue. |
Yes, painless would resolve these lazily. However, it is possible this could be handled in the future by the multi pass compiler, which (at least as planned right now at a high level), would allow introspecting the compiled script. For example, we want this so we can find at compile time which fields are going to be accessed for doc values, ahead of trying to run the script. Something similar could be done for bucket_path. Since these ordering constraints look critical to correctness, I will mark this as stalled and wait on the painless changes. /cc @jdconrad |
We do have the infrastructure to do this sort of thing now. Extra compiler passes and stuff. But since no one has poked at this in years and years I don't think this is worth doing. It's better, for sure. But it's a pain to make backwards breaking changes and probably not worth the time now. |
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 usebuckets_path
at all, and have abuckets
variable available in the script. eg:Current:
Potential new script use:
The text was updated successfully, but these errors were encountered: