lib/Elastica/Search.php
public function addIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        if (!\is_scalar($index)) {
            throw new InvalidException('Invalid param type');
        }

        $this->_indices[] = (string) $index;

        return $this;
    }
public function addIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        if (!\is_scalar($index)) {
            throw new InvalidException('Invalid param type');
        }

        $this->_indices[] = (string) $index;

        return $this;
    }
public function addIndex ( $ index ) { if ( $ index instanceof Index ) { $ index = $ index -> getName ( ) ; } if ( ! \ is_scalar ( $ index ) ) { throw new InvalidException ( 'Invalid param type' ) ; } $ this -> _indices [ ] = ( string ) $ index ; return $ this ; }
Adds a index to the list.

@param \Elastica\Index|string $index Index object or string

@throws \Elastica\Exception\InvalidException

@return $this
Adds a index to the list .