Executing the terms aggregation