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

Expose `ctx._now` in update scripts #20835

Merged
merged 1 commit into from Oct 10, 2016

Conversation

Projects
None yet
2 participants
@s1monw
Copy link
Contributor

commented Oct 10, 2016

Update scripts might want to update the documents _timestamp but need a notion of now().
Painless doesn't support any notion of now() since it would make scripts non-pure functions. Yet,
in the update case this is a valid value and we can pass it with the context together to allow the
script to record the timestamp the document was updated.

Relates to #17895

Expose `ctx._now` in update scripts
Update scripts might want to update the documents `_timestamp` but need a notion of `now()`.
Painless doesn't support any notion of now() since it would make scripts non-pure functions. Yet,
in the update case this is a valid value and we can pass it with the context together to allow the
script to record the timestamp the documetn was updated.

Relates to #17895
@s1monw

This comment has been minimized.

Copy link
Contributor Author

commented Oct 10, 2016

@rjernst @clintongormley can you look

@rjernst

This comment has been minimized.

Copy link
Member

commented Oct 10, 2016

LGTM

@s1monw s1monw merged commit 37ca38d into elastic:master Oct 10, 2016

2 checks passed

CLA Commit author is a member of Elasticsearch
Details
elasticsearch-ci Build finished.
Details

s1monw added a commit that referenced this pull request Oct 10, 2016

Expose `ctx._now` in update scripts (#20835)
Update scripts might want to update the documents `_timestamp` but need a notion of `now()`.
Painless doesn't support any notion of now() since it would make scripts non-pure functions. Yet,
in the update case this is a valid value and we can pass it with the context together to allow the
script to record the timestamp the document was updated.

Relates to #17895

clintongormley added a commit that referenced this pull request Oct 11, 2016

clintongormley added a commit that referenced this pull request Oct 11, 2016

clintongormley added a commit that referenced this pull request Oct 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.