예제 #1
0
파일: Solr.php 프로젝트: royopa/SolrBundle
 /**
  * @param object                   $doc
  * @param MetaInformationInterface $metaInformation
  * @param Event                    $event
  */
 private function addDocumentToIndex($doc, MetaInformationInterface $metaInformation, Event $event)
 {
     try {
         $indexName = $metaInformation->getIndex();
         $client = new \FS\SolrBundle\Client\Client($this->solrClientCore);
         $client->update($doc, $indexName);
     } catch (\Exception $e) {
         $errorEvent = new ErrorEvent(null, $metaInformation, json_encode($this->solrClientCore->getOptions()), $event);
         $errorEvent->setException($e);
         $this->eventManager->dispatch(Events::ERROR, $errorEvent);
     }
 }