示例#1
0
 /**
  * @param MetaInformationInterface $metaInformation
  */
 public function setMetaInformation($metaInformation)
 {
     $this->metaInformation = $metaInformation;
     $this->entity = $metaInformation->getEntity();
     $this->index = $metaInformation->getIndex();
 }
示例#2
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);
     }
 }