Multiply aggregation value by a number within the query

{"took":106,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":339795,"max_score":0.0,"hits":[]},"aggregations":{"date_histogram:doc.timeframe":{"buckets":[{"key_as_string":"2015-02-27T07:00:00.000Z","key":1425020400000,"doc_count":864,"cardinality:doc.key":{"value":216}},{"key_as_string":"2015-02-27T08:00:00.000Z","key":1425024000000,"doc_count":1550,"cardinality:doc.key":{"value":322}}]}
}}

Hello,

my result looks like the one above.

The query aggregates all keys by the hour. The value is the count of equal keys by the hour.

Since the keys only reflect 50% of the observations, I want to multiply each value by the factor 2.

So

key = 1425020400000 with value = 216

would be

key = 1425020400000 with value = 432

How can I achieve this?

I haven't found anything. I think scripting could be an option.

But how to reuse the aggregation in the same query?

Thanks for an answer.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d6b602f2-c3ea-40eb-9968-1991bc888618%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.