Elasticsearch script field: add an aggregated field

Is there a way to add an aggregated filed to each document?
For example, I want to find the timestamp of the oldest/first document containing a specific hash value and store it as an extra field for each document. How can I do it in Elasticsearch?
I want to use the oldest timestamp to compare with the timestamp for each document so that I can filter out documents whose timestamp is newer than the oldest.

Scripted fields act in the context of a single document, so do not have access to that kind of information.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.