Import_all_data_to_solr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Ingest script to import all the data in the complete directory into solr | |
*/ | |
include('ingest.php'); | |
class Import_all_data_to_solr { | |
public $ingest; | |
public function __construct() | |
{ | |
$this->ingest = new Ingest(); | |
$this->search_dir(); | |
} | |
private function search_dir() | |
{ | |
$rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator('complete')); | |
foreach ($rii as $file) { | |
if ($file->isDir()){ | |
continue; | |
} | |
echo($file->getPathname()) . "\n"; | |
$this->sendToSolr($file->getPathname()); | |
} | |
} | |
/** | |
* Solr ingest | |
* @param string $file [description] | |
*/ | |
private function sendToSolr($file) | |
{ | |
$this->ingest->getData($file); | |
} | |
} | |
(new Import_all_data_to_solr()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment