dataset; // only index Opus_Document instances if (false === ($dataset instanceof Dataset)) { return; } if ($dataset->server_state !== 'published') { // if ($dataset->getServerState() !== 'temporary') { // $this->removeDocumentFromIndexById($model->getId()); // } return; } $this->addDatasetToIndex($dataset); } /** * Helper method to add dataset to index. * * @param Opus_Document $document * @return void */ private function addDatasetToIndex(Dataset $dataset) { $datasetId = $dataset->id; Log::debug(__METHOD__ . ': ' . 'Adding index job for dataset ' . $datasetId . '.'); try { // Opus_Search_Service::selectIndexingService('onDocumentChange') $service = new SolariumAdapter("solr", config('solarium')); $service->addDatasetsToIndex($dataset); } catch (Opus_Search_Exception $e) { Log::debug(__METHOD__ . ': ' . 'Indexing document ' . $documentId . ' failed: ' . $e->getMessage()); } catch (InvalidArgumentException $e) { Log::warning(__METHOD__ . ': ' . $e->getMessage()); } } }