lib/Elastica/Type.php
public function setMapping($mapping, array $query = [])
    {
        $mapping = Mapping::create($mapping);
        $mapping->setType($this);

        return $mapping->send($query);
    }
public function setMapping($mapping, array $query = [])
    {
        $mapping = Mapping::create($mapping);
        $mapping->setType($this);

        return $mapping->send($query);
    }
public function setMapping ( $ mapping , array $ query = [ ] ) { $ mapping = Mapping :: create ( $ mapping ) ; $ mapping -> setType ( $ this ) ; return $ mapping -> send ( $ query ) ; }
Sets value type mapping for this type.

@param \Elastica\Type\Mapping|array $mapping Elastica\Type\MappingType object or property array with all mappings
@param array                        $query   querystring when put mapping (for example update_all_types)

@return \Elastica\Response
Sets value type mapping for this type .