lib/Elastica/Search.php
public function addType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        if (!\is_string($type)) {
            throw new InvalidException('Invalid type type');
        }

        $this->_types[] = $type;

        return $this;
    }
public function addType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        if (!\is_string($type)) {
            throw new InvalidException('Invalid type type');
        }

        $this->_types[] = $type;

        return $this;
    }
public function addType ( $ type ) { if ( $ type instanceof Type ) { $ type = $ type -> getName ( ) ; } if ( ! \ is_string ( $ type ) ) { throw new InvalidException ( 'Invalid type type' ) ; } $ this -> _types [ ] = $ type ; return $ this ; }
Adds a type to the current search.

@param \Elastica\Type|string $type Type name or object

@throws \Elastica\Exception\InvalidException

@return $this
Adds a type to the current search .