Create update_search_index.php

This commit is contained in:
Roman Kelesidis 2025-08-21 11:13:11 +03:00
commit 74cfd90d60
No known key found for this signature in database
GPG key ID: D8157C4D4C4C6DB4

View file

@ -0,0 +1,32 @@
<?php
/**
* TorrentPier Bull-powered BitTorrent tracker engine
*
* @copyright Copyright (c) 2005-2025 TorrentPier (https://torrentpier.com)
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
*/
if (!defined('BB_ROOT')) {
die(basename(__FILE__));
}
$offset = 0;
$limit = 1000;
$total_indexed = 0;
do {
$indexed = index_data_to_manticore($limit, $offset);
if ($indexed === false) {
echo "Error during indexing at offset $offset\n";
break;
}
$total_indexed += $indexed;
$offset += $limit;
echo "Indexed $indexed records, total: $total_indexed\n";
usleep(100000); // 0.1 секунды
} while ($indexed > 0);
echo "Indexing completed. Total records: $total_indexed\n";