protected function createMappings(\Elastica\Index $index) {
        foreach ($this->getIndexedClasses() as $class) {
			/** @var $sng Searchable */
			$sng = singleton($class);
            
            $type = $sng->getElasticaType();
            if (isset($this->mappings[$type])) {
                // captured later
                continue;
            }

			$mapping = $sng->getElasticaMapping();
			$mapping->setType($index->getType($type));
			$mapping->send();
		}
        
        if ($this->mappings) {
            foreach ($this->mappings as $type => $fields) {
                $mapping = new Mapping();
                $mapping->setProperties($fields);
                $mapping->setParam('date_detection', false);
                
                $mapping->setType($index->getType($type));
                $mapping->send();
            }
        }
    }
protected function createMappings(\Elastica\Index $index) {
        foreach ($this->getIndexedClasses() as $class) {
			/** @var $sng Searchable */
			$sng = singleton($class);
            
            $type = $sng->getElasticaType();
            if (isset($this->mappings[$type])) {
                // captured later
                continue;
            }

			$mapping = $sng->getElasticaMapping();
			$mapping->setType($index->getType($type));
			$mapping->send();
		}
        
        if ($this->mappings) {
            foreach ($this->mappings as $type => $fields) {
                $mapping = new Mapping();
                $mapping->setProperties($fields);
                $mapping->setParam('date_detection', false);
                
                $mapping->setType($index->getType($type));
                $mapping->send();
            }
        }
    }
protected function createMappings ( \ Elastica \ Index $ index ) { foreach ( $ this -> getIndexedClasses ( ) as $ class ) { /** @var $sng Searchable */ $ sng = singleton ( $ class ) ; $ type = $ sng -> getElasticaType ( ) ; if ( isset ( $ this -> mappings [ $ type ] ) ) { // captured later continue ; } $ mapping = $ sng -> getElasticaMapping ( ) ; $ mapping -> setType ( $ index -> getType ( $ type ) ) ; $ mapping -> send ( ) ; } if ( $ this -> mappings ) { foreach ( $ this -> mappings as $ type => $ fields ) { $ mapping = new Mapping ( ) ; $ mapping -> setProperties ( $ fields ) ; $ mapping -> setParam ( 'date_detection' , false ) ; $ mapping -> setType ( $ index -> getType ( $ type ) ) ; $ mapping -> send ( ) ; } } }
Define all known mappings
Define all known mappings