protected function createType(Index $index, $typeName)
    {
        Assertion::minLength($typeName, 1, 'Type name must be at least one char long');

        $type = $index->getType($typeName);
        $options = $this->mergeDefaultOptions();

        $mappingObject = new Mapping();
        if (!empty($options['mapping'])) {
            $mappingObject->setProperties($options['mapping']);
        }
        if (!empty($options['_source'])) {
            $mappingObject->setSource($options['_source']);
        }
        if (!empty($options['mapping']) || !empty($options['_source'])) {
            $type->setMapping($mappingObject);
        }
    }