<commit_before><?php

if($argc != 2)
{
	echo "Arguments missing.\n\n";
	echo "Usage: php updatePartnerEntries2Sphinx.php {partner id}\n";
	exit;
} 
$partnerId = $argv[1];



ini_set("memory_limit","1024M");

define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../'));
require_once(ROOT_DIR . '/infra/bootstrap_base.php');
require_once(ROOT_DIR . '/infra/KAutoloader.php');

KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "metadata", "*"));
KAutoloader::setClassMapFilePath('../cache/classMap.cache');
KAutoloader::register();

error_reporting(E_ALL);
KalturaLog::setLogger(new KalturaStdoutLogger());

$dbConf = kConf::getDB();
DbManager::setConfig($dbConf);
DbManager::initialize();


$c = new Criteria();
$c->add(entryPeer::PARTNER_ID, $partnerId);
entryPeer::setUseCriteriaFilter(false);
$entries = entryPeer::doSelect($c);
foreach($entries as $entry)
{
	usleep(100);
	$entry->saveToSphinx(false, true);
	echo $entry->getId() . "Saved\n";
}
echo "Done\n";<commit_msg>Sphinx moved to plugin<commit_after><?php

if($argc != 2)
{
	echo "Arguments missing.\n\n";
	echo "Usage: php updatePartnerEntries2Sphinx.php {partner id}\n";
	exit;
} 
$partnerId = $argv[1];



ini_set("memory_limit","1024M");

define('ROOT_DIR', realpath(dirname(__FILE__) . '/../../'));
require_once(ROOT_DIR . '/infra/bootstrap_base.php');
require_once(ROOT_DIR . '/infra/KAutoloader.php');

KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "vendor", "propel", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "metadata", "*"));
KAutoloader::addClassPath(KAutoloader::buildPath(KALTURA_ROOT_PATH, "plugins", "sphinx_search", "*"));
KAutoloader::setClassMapFilePath('../cache/classMap.cache');
KAutoloader::register();

error_reporting(E_ALL);
KalturaLog::setLogger(new KalturaStdoutLogger());

$dbConf = kConf::getDB();
DbManager::setConfig($dbConf);
DbManager::initialize();

$sphinx = new kSphinxSearchManager();

$c = new Criteria();
$c->add(entryPeer::PARTNER_ID, $partnerId);
entryPeer::setUseCriteriaFilter(false);
$entries = entryPeer::doSelect($c);
foreach($entries as $entry)
{
	usleep(100);
	$sphinx->saveToSphinx($entry, false, true);
	echo $entry->getId() . "Saved\n";
}
echo "Done\n";
{'fraction_non_alphanumeric': 0.19787685774946923, 'fraction_numerical': 0.008492569002123142, 'mean_word_length': 8.312252964426877, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4143962', 'n_tokens_mistral': 907, 'n_tokens_neox': 882, 'n_words': 121}