Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 public function createType(ClassMetadata $metadata)
 {
     $indexName = $metadata->timeSeriesScale ? $metadata->getCurrentTimeSeriesIndex() : $metadata->index;
     $type = $this->getIndex($indexName)->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->dynamic)) {
         $mapping->setParam('dynamic', $metadata->dynamic);
     }
     if (isset($metadata->parent)) {
         $mapping->setParent($metadata->parent);
     }
     foreach ($rootProperties as $key => $value) {
         $mapping->setParam($key, $value);
     }
     $mapping->send();
     return $type;
 }