lib/Elastica/Type/AbstractType.php
public function create(bool $recreate = false)
    {
        $this->getIndex()->create($this->_indexParams, $recreate);

        $mapping = new Mapping($this->getType());
        $mapping->setProperties($this->_mapping);
        $mapping->setSource(['enabled' => $this->_source]);
        $mapping->send();
    }
public function create(bool $recreate = false)
    {
        $this->getIndex()->create($this->_indexParams, $recreate);

        $mapping = new Mapping($this->getType());
        $mapping->setProperties($this->_mapping);
        $mapping->setSource(['enabled' => $this->_source]);
        $mapping->send();
    }
public function create ( bool $ recreate = false ) { $ this -> getIndex ( ) -> create ( $ this -> _indexParams , $ recreate ) ; $ mapping = new Mapping ( $ this -> getType ( ) ) ; $ mapping -> setProperties ( $ this -> _mapping ) ; $ mapping -> setSource ( [ 'enabled' => $ this -> _source ] ) ; $ mapping -> send ( ) ; }
Creates the index and sets the mapping for this type.

@param bool $recreate OPTIONAL Recreates the index if true (default = false)
Creates the index and sets the mapping for this type .