Skip to content
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

Consistent now access in scripting #77199

Open
stu-elastic opened this issue Sep 2, 2021 · 1 comment
Open

Consistent now access in scripting #77199

stu-elastic opened this issue Sep 2, 2021 · 1 comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team

Comments

@stu-elastic
Copy link
Contributor

We discourage users from using now in painless. However, now is a supported time in range queries and date range aggs.

Painless exposes Java methods such as System.currentTimeMillis() but the return values from those API calls will not be consistent across executions in the same request.

A consistent view of time is available in SearchExecutionContext.nowInMillis() but, importantly, that API ensures the results are not cached.

We should provide a way for users to use a consistent version of now in painless while ensuring it works with percolator and correctly caches scripts.

@stu-elastic stu-elastic added >enhancement :Core/Infra/Scripting Scripting abstractions, Painless, and Mustache labels Sep 2, 2021
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Sep 2, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Scripting Scripting abstractions, Painless, and Mustache >enhancement Team:Core/Infra Meta label for core/infra team
Projects
None yet
Development

No branches or pull requests

2 participants