/** * @param string $clusterIdentifier * @param array $applicationIds * @throws ezfSolrException */ public static function reindex( $clusterIdentifier, $applicationIds = array() ) { $applicationSearch = new self(); $solrBase = new eZSolrBase(); $url = $solrBase->SearchServerURI . '/update'; // delete all $solrBase->sendHTTPRequest( $url, $applicationSearch->bulidDeleteXml( $clusterIdentifier ), 'text/xml' ); $solrBase->commit(); // add wanted $xml = $applicationSearch->bulidUpdateXml( $clusterIdentifier, $applicationIds ); $solrBase->sendHTTPRequest( $url, $xml, 'text/xml' ); $solrBase->commit(); }
$evrikaTool = new EvrikaTool($merckINI->variable('EvrikaCalendar', 'RSSUrl') . $year . '/' . $month , 'evrika-calendar', $i); $evrikaTool->importXMLToDatabase(); } else { $importFromMonths = -2; $importToMonths = 4; if( date('N', time()) == 3 ) { echo "\n Remove all solr evrika content \n"; $solrBase = new eZSolrBase(); $url = $solrBase->SearchServerURI . '/update'; // Remove all solr evrika content $deleteQuery = '<delete><query>subattr_publisher_folder___source_id____s:evrika_calendar_ru</query></delete>'; $solrBase->sendHTTPRequest( $url, $deleteQuery, 'text/xml' ); $solrBase->commit(); $importFromMonths = -4; $importToMonths = 8; } //import the 8 next months for($i=$importFromMonths; $i<$importToMonths; $i++) { echo "\n Evrika Calendar URL : " . $merckINI->variable('EvrikaCalendar', 'RSSUrl') . date('Y/m', strtotime('+' . $i . ' month')) . " \n"; $evrikaTool = new EvrikaTool($merckINI->variable('EvrikaCalendar', 'RSSUrl') . date('Y/m', strtotime('+' . $i . ' month')) , 'evrika-calendar', $i); $evrikaTool->importXMLToDatabase(); } } $script->shutdown();