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

        $this->solrConnection = $solrConnection;
    }