Is its possible to execute an aggregation query on an index and use the results in one action to enrich the same index/documents with it.
Assume i have serveral document with field region, sensor type sensor. I want to add to each document the number of times the sensor triggered, the number of times it was a certain sensor type and how many times it happend in a region. The aggregation of counting the values are in time frames of 5min.