final public function createType(Index $index, SchemaQName $qname): Type
    {
        $type = new Type($index, $this->getTypeName($qname));
        $mapping = $this->getNodeMapper($qname)->getMapping($qname);
        $mapping->setType($type);

        try {
            $mapping->send();
        } catch (\Throwable $e) {
            throw new SearchOperationFailed(
                sprintf(
                    '%s while putting mapping for type [%s/%s] into ElasticSearch for qname [%s].',
                    ClassUtils::getShortName($e),
                    $index->getName(),
                    $type->getName(),
                    $qname
                ),
                Code::INTERNAL,
                $e
            );
        }

        return $type;
    }