/** * @covers AppSolr::synchronizePendingApplications * * @depends testApplicationChangedUpdateSolrQueue */ public function testSynchronizePendingApplications() { //count number of indexed applications $count = $this->object->getCountApplicationsSearchIndex(); print "Total applications:" . $count; //delete application marked in previous test $this->object->synchronizePendingApplications(); $count2 = $this->object->getCountApplicationsSearchIndex(); print "Total applications deleted record:" . $count2; $this->assertEquals($count, $count2 + 1, 'Error synchronizing applications in search index'); //leave index as in the beginning $this->object->reindexAllApplications(); $count3 = $this->object->getCountApplicationsSearchIndex(); $this->assertEquals($count, $count3, 'Error restoring deleted application in search index'); }
function processWorkspace() { global $sLastExecution; global $ScriptAction; global $SkipRecords; global $TrunkSize; global $appUid; try { if (($solrConf = System::solrEnv(SYS_SYS)) !== false) { G::LoadClass('AppSolr'); print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n"; print "solr_enabled: " . $solrConf['solr_enabled'] . "\n"; print "solr_host: " . $solrConf['solr_host'] . "\n"; print "solr_instance: " . $solrConf['solr_instance'] . "\n"; $oAppSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']); if ($ScriptAction == "reindexall") { $oAppSolr->reindexAllApplications($SkipRecords, $TrunkSize); } if ($ScriptAction == "reindexmissing") { $oAppSolr->synchronizePendingApplications(); } if ($ScriptAction == "optimizeindex") { $oAppSolr->optimizeSearchIndex(); } if ($ScriptAction == "reindexone") { if ($appUid == "") { print "Missing -appuid parameter. please complete it with this option.\n"; } $oAppSolr->updateApplicationSearchIndex($appUid); } } else { print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini"; } } catch (Exception $oError) { saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n"); } }
function processWorkspace() { global $sLastExecution; global $ScriptAction; try { if (($solrConf = System::solrEnv(SYS_SYS)) !== false) { G::LoadClass('AppSolr'); print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n"; print "solr_enabled: " . $solrConf['solr_enabled'] . "\n"; print "solr_host: " . $solrConf['solr_host'] . "\n"; print "solr_instance: " . $solrConf['solr_instance'] . "\n"; $oAppSolr = new AppSolr($solrConf['solr_enabled'], $solrConf['solr_host'], $solrConf['solr_instance']); if ($ScriptAction == "reindexall") { $oAppSolr->reindexAllApplications(); } if ($ScriptAction == "reindexmissing") { $oAppSolr->synchronizePendingApplications(); } } else { print "Incomplete Solr configuration. See configuration file: " . PATH_DATA_SITE . "env.ini"; } } catch (Exception $oError) { saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n"); } }