/**
  * @param Index $elasticaIndex
  */
 protected function setMapping(Index $elasticaIndex)
 {
     foreach ($this->configuration->getTypes() as $typeName) {
         $mapping = new Mapping();
         $type = $elasticaIndex->getType($typeName);
         $mapping->setType($type);
         // Set properties
         if ($properties = $this->configuration->getMappingProperties($type)) {
             $mapping->setProperties($properties);
         }
         // Set params if any
         if ($mappingParams = $this->configuration->getMappingParams($type)) {
             foreach ($mappingParams as $mappingParam => $mappingParamValue) {
                 $mapping->setParam($mappingParam, $mappingParamValue);
             }
         }
         if ($mappingParams || $properties) {
             $mapping->send();
         }
     }
 }