implemented the count aggregator as a multi-bucket aggregator