bin/php/updatesearchindexsolr.php
protected function checkSolrRunning()
    {
        $eZFindINI = eZINI::instance( 'ezfind.ini' );
        if ( $eZFindINI->variable( 'LanguageSearch', 'MultiCore' ) === 'enabled' )
        {
            $shards = eZINI::instance( 'solr.ini' )->variable( 'SolrBase', 'Shards' );
            foreach ( $eZFindINI->variable( 'LanguageSearch', 'LanguagesCoresMap' ) as $locale => $coreName )
            {
                if ( isset( $shards[$coreName] ) )
                {
                    if ( !$this->isSolrRunning( $shards[$coreName] ) )
                    {
                        $this->CLI->error( "The '$coreName' Solr core is not running." );
                        $this->CLI->error( 'Please, ensure the server is started and the configurations of eZ Find and Solr are correct.' );
                        return false;
                    }
                }
                else
                {
                    $this->CLI->error( "Locale '$locale' is mapped to a core that is not listed in solr.ini/[SolrBase]/Shards." );
                    return false;
                }
            }
            return true;
        }
        else
        {
            $ret = $this->isSolrRunning();
            if ( !$ret )
            {
                $this->CLI->error( "The Solr server couldn't be reached." );
                $this->CLI->error( 'Please, ensure the server is started and the configuration of eZ Find is correct.' );
            }
            return $ret;
        }
    }
protected function checkSolrRunning()
    {
        $eZFindINI = eZINI::instance( 'ezfind.ini' );
        if ( $eZFindINI->variable( 'LanguageSearch', 'MultiCore' ) === 'enabled' )
        {
            $shards = eZINI::instance( 'solr.ini' )->variable( 'SolrBase', 'Shards' );
            foreach ( $eZFindINI->variable( 'LanguageSearch', 'LanguagesCoresMap' ) as $locale => $coreName )
            {
                if ( isset( $shards[$coreName] ) )
                {
                    if ( !$this->isSolrRunning( $shards[$coreName] ) )
                    {
                        $this->CLI->error( "The '$coreName' Solr core is not running." );
                        $this->CLI->error( 'Please, ensure the server is started and the configurations of eZ Find and Solr are correct.' );
                        return false;
                    }
                }
                else
                {
                    $this->CLI->error( "Locale '$locale' is mapped to a core that is not listed in solr.ini/[SolrBase]/Shards." );
                    return false;
                }
            }
            return true;
        }
        else
        {
            $ret = $this->isSolrRunning();
            if ( !$ret )
            {
                $this->CLI->error( "The Solr server couldn't be reached." );
                $this->CLI->error( 'Please, ensure the server is started and the configuration of eZ Find is correct.' );
            }
            return $ret;
        }
    }
protected function checkSolrRunning ( ) { $ eZFindINI = eZINI :: instance ( 'ezfind.ini' ) ; if ( $ eZFindINI -> variable ( 'LanguageSearch' , 'MultiCore' ) === 'enabled' ) { $ shards = eZINI :: instance ( 'solr.ini' ) -> variable ( 'SolrBase' , 'Shards' ) ; foreach ( $ eZFindINI -> variable ( 'LanguageSearch' , 'LanguagesCoresMap' ) as $ locale => $ coreName ) { if ( isset ( $ shards [ $ coreName ] ) ) { if ( ! $ this -> isSolrRunning ( $ shards [ $ coreName ] ) ) { $ this -> CLI -> error ( "The '$coreName' Solr core is not running." ) ; $ this -> CLI -> error ( 'Please, ensure the server is started and the configurations of eZ Find and Solr are correct.' ) ; return false ; } } else { $ this -> CLI -> error ( "Locale '$locale' is mapped to a core that is not listed in solr.ini/[SolrBase]/Shards." ) ; return false ; } } return true ; } else { $ ret = $ this -> isSolrRunning ( ) ; if ( ! $ ret ) { $ this -> CLI -> error ( "The Solr server couldn't be reached." ) ; $ this -> CLI -> error ( 'Please, ensure the server is started and the configuration of eZ Find is correct.' ) ; } return $ ret ; } }
Tells whether Solr is running by replying to ping request.
In a multicore setup, all cores used to index content are checked.

@return bool
Tells whether Solr is running by replying to ping request . In a multicore setup all cores used to index content are checked .