Adds types in profile_name_search and fixes a related few bugs.
[platal.git] / bin / search.rebuild_db.php
index 829d032..81fa957 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2009 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -29,12 +29,13 @@ $globals->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)');
+                  LEFT JOIN  auth_user_quick USING(user_id)');
 $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);
+    _user_reindex($uid, $tmp, $muls, $pub);
     printf("\r%u / %u",  ++$i, $res->total());
 }