public function setSolrConnection(SolrConnection $solrConnection)
    {
        if (!$solrConnection->getWriteService()->ping()) {
            throw new \Exception(
                'Could not connect to Solr server.',
                1323946472
            );
        }

        $this->solrConnection = $solrConnection;
    }
public function setSolrConnection(SolrConnection $solrConnection)
    {
        if (!$solrConnection->getWriteService()->ping()) {
            throw new \Exception(
                'Could not connect to Solr server.',
                1323946472
            );
        }

        $this->solrConnection = $solrConnection;
    }
public function setSolrConnection ( SolrConnection $ solrConnection ) { if ( ! $ solrConnection -> getWriteService ( ) -> ping ( ) ) { throw new \ Exception ( 'Could not connect to Solr server.' , 1323946472 ) ; } $ this -> solrConnection = $ solrConnection ; }
Allows to provide a Solr server connection other than the one
initialized by the constructor.

@param SolrConnection $solrConnection Solr connection
@throws \Exception if the Solr server cannot be reached
Allows to provide a Solr server connection other than the one initialized by the constructor .