protected function addSubAggregation(string $parentPath, string $name, array $aggregationConfiguration): void
    {
        // Find the parentPath
        $path =& $this->request['aggregations'];

        foreach (explode('.', $parentPath) as $subPart) {
            if ($path === null || !array_key_exists($subPart, $path)) {
                throw new Exception\QueryBuildingException(sprintf('The parent path segment "%s" could not be found when adding a sub aggregation to parent path "%s"', $subPart, $parentPath));
            }
            $path =& $path[$subPart]['aggregations'];
        }

        $path[$name] = $aggregationConfiguration;
    }