public function createType(ClassMetadata $metadata)
{
$type = $this->getIndex($metadata->index)->getType($metadata->type);
$properties = $this->getMapping($metadata->fieldMappings);
$rootProperties = $this->getRootMapping($metadata->rootMappings);
$mapping = new Mapping($type, $properties);
$mapping->disableSource($metadata->source);
if (isset($metadata->boost)) {
$mapping->setParam('_boost', array('name' => '_boost', 'null_value' => $metadata->boost));
}
if (isset($metadata->parent)) {
$mapping->setParent($metadata->parent);
}
foreach ($rootProperties as $key => $value) {
$mapping->setParam($key, $value);
}
$mapping->send();
return $type;
}