cancelExistingJobs('SolrReindexQueuedJob'); $groups = $this->cancelExistingJobs('SolrReindexGroupQueuedJob'); $logger->info("Cancelled {$queues} re-index tasks and {$groups} re-index groups"); // Although this class is used as a service (singleton) it may also be instantiated // as a queuedjob $job = Injector::inst()->create('SolrReindexQueuedJob', $batchSize, $taskName, $classes); $this ->getQueuedJobService() ->queueJob($job); $title = $job->getTitle(); $logger->info("Queued {$title}"); } protected function processGroup( LoggerInterface $logger, SolrIndex $indexInstance, $state, $class, $groups, $group, $taskName ) { // Trigger another job for this group $job = Injector::inst()->create( 'SolrReindexGroupQueuedJob', get_class($indexInstance), $state, $class, $groups, $group ); $this ->getQueuedJobService() ->queueJob($job); $title = $job->getTitle(); $logger->info("Queued {$title}"); } public function runGroup( LoggerInterface $logger, SolrIndex $indexInstance, $state, $class, $groups, $group ) { parent::runGroup($logger, $indexInstance, $state, $class, $groups, $group); // After any changes have been made, mark all indexes as dirty for commit // see http://stackoverflow.com/questions/7512945/how-to-fix-exceeded-limit-of-maxwarmingsearchers $logger->info("Queuing commit on all changes"); SearchUpdateCommitJobProcessor::queue(); } }