lib/Elastica/Status.php
public function getIndicesWithAlias($alias)
    {
        $endpoint = new Get();
        $endpoint->setName($alias);

        $response = null;

        try {
            $response = $this->_client->requestEndpoint($endpoint);
        } catch (ResponseException $e) {
            // 404 means the index alias doesn't exist which means no indexes have it.
            if (404 === $e->getResponse()->getStatus()) {
                return [];
            }
            // If we don't have a 404 then this is still unexpected so rethrow the exception.
            throw $e;
        }
        $indices = [];
        foreach ($response->getData() as $name => $unused) {
            $indices[] = new Index($this->_client, $name);
        }

        return $indices;
    }
public function getIndicesWithAlias($alias)
    {
        $endpoint = new Get();
        $endpoint->setName($alias);

        $response = null;

        try {
            $response = $this->_client->requestEndpoint($endpoint);
        } catch (ResponseException $e) {
            // 404 means the index alias doesn't exist which means no indexes have it.
            if (404 === $e->getResponse()->getStatus()) {
                return [];
            }
            // If we don't have a 404 then this is still unexpected so rethrow the exception.
            throw $e;
        }
        $indices = [];
        foreach ($response->getData() as $name => $unused) {
            $indices[] = new Index($this->_client, $name);
        }

        return $indices;
    }
public function getIndicesWithAlias ( $ alias ) { $ endpoint = new Get ( ) ; $ endpoint -> setName ( $ alias ) ; $ response = null ; try { $ response = $ this -> _client -> requestEndpoint ( $ endpoint ) ; } catch ( ResponseException $ e ) { // 404 means the index alias doesn't exist which means no indexes have it. if ( 404 === $ e -> getResponse ( ) -> getStatus ( ) ) { return [ ] ; } // If we don't have a 404 then this is still unexpected so rethrow the exception. throw $ e ; } $ indices = [ ] ; foreach ( $ response -> getData ( ) as $ name => $ unused ) { $ indices [ ] = new Index ( $ this -> _client , $ name ) ; } return $ indices ; }
Returns an array with all indices that the given alias name points to.

@param string $alias Alias name

@return array|\Elastica\Index[] List of Elastica\Index
Returns an array with all indices that the given alias name points to .