private function buildAggQueryData($query)
    {
        $ret = [];

        foreach ($this->aggregations as $agg) {
            $additions = $agg->buildQueryData($this, $query);
            if ($additions) {
                $ret = array_merge($ret, $additions);
            }
        }

        return $ret;
    }