1. Go to this page and download the library: Download reliefweb/api-indexer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
reliefweb / api-indexer example snippets
composer
useRWAPIIndexer\Manager;
// Indexing options to index all reports.
$options = array(
'bundle' => 'report',
'elasticsearch' => 'http://127.0.0.1:9200',
'mysql-host' => 'localhost',
'mysql-port' => 3306,
'mysql-user' => 'root',
'mysql-pass' => '',
'database' => 'DATABASE_NAME',
'base-index-name' => 'ELASTICSEARCH_INDEX_PREFIX',
'tag' => '',
'website' => 'https://reliefweb.int',
'limit' => 0,
'offset' => 0,
'chunk-size' => 500,
'id' => 0,
'remove' => FALSE,
'alias' => TRUE,
);
// Create the indexing manager.
$manager = new Manager($options);
// Index or delete based on the provided options.
$manager->execute();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.