X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fsearch.rebuild_db.php;h=5e43d31ad12fceeeadadb295960c696f8d13df6b;hb=aab2ffddfc8597dfce114b18c737b791e949b6ea;hp=c201f21442a677d59b12740750f13970562ca207;hpb=55546c0db778c2d8f9d7debd30117931dc39ff16;p=platal.git diff --git a/bin/search.rebuild_db.php b/bin/search.rebuild_db.php index c201f21..5e43d31 100755 --- a/bin/search.rebuild_db.php +++ b/bin/search.rebuild_db.php @@ -1,7 +1,7 @@ #!/usr/bin/php5 -q debug = 0; // Do not store backtraces -XDB::execute('DELETE FROM search_name'); -$res = XDB::iterRow('SELECT auth_user_md5.user_id, nom, prenom, nom_usage, profile_nick - FROM auth_user_md5 - LEFT JOIN auth_user_quick USING(user_id)'); +$res = XDB::iterRow('SELECT pid + FROM profiles'); $i = 0; -$muls = array(1, 1, 1, 0.2); -$pub = array(true, true, true, false); -while ($tmp = $res->next()) { - $uid = array_shift($tmp); - _user_reindex($uid, $tmp, $muls, $pub); - printf("\r%u / %u", ++$i, $res->total()); +$n = $res->total(); +while ($pid = $res->next()) { + Profile::rebuildSearchTokens(intval($pid[0])); + printf("\r%u / %u", ++$i, $n); } print "done\n";