Sequential aggregation for elasticsearch (still in progress)