示例#1
0
 /**
  * @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);
     }
 }