How to do sum aggregations in Java API?

I have a query similar to the following SQL:

select sum(count+displayCount) as total from day_inc_count group by video_id

My problem is how to implement the above using aggregation in REST or Java
API.
I don't understand aggregations in elasticsearch 1.0 very much. Hope
somebody could help.
Thanks very much.

--
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/1221f193-b61b-477c-97a6-d1cf8ab6cc1a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.