/**
  * Create the mapping for the type.
  *
  * @param \Cake\Datasource\ConnectionInterface $db The Elasticsearch connection
  * @return void
  */
 public function create(ConnectionInterface $db)
 {
     if (empty($this->schema)) {
         return;
     }
     $index = $db->getIndex();
     if (!$index->exists()) {
         $index->create();
     }
     $type = $index->getType($this->table);
     $mapping = new ElasticaMapping();
     $mapping->setType($type);
     $mapping->setProperties($this->schema);
     $mapping->send();
     $this->created[] = $db->configName();
 }