Automatically focus OpenID field on login page
[phorkie.git] / scripts / index.php
index eb328b50cc243df40a4210925865a8af7e457baa..5da912e2aa9750faceaa004c20841cb5847feceb 100644 (file)
@@ -28,20 +28,17 @@ if ($GLOBALS['phorkie']['cfg']['setupcheck']) {
 $db = new Database();
 $idx = $db->getIndexer();
 
-//cleanup
-echo "Deleting all index data\n";
-$idx->deleteAllRepos();
-
 //create mapping
-echo "Index setup\n";
-$db->getSetup()->setup();
+echo "Index reset\n";
+$db->getSetup()->reset();
 
 
 $rs = new Repositories();
 list($repos, $count) = $rs->getList(0, 10000);
-$idx = new Indexer_Elasticsearch();
 foreach ($repos as $repo) {
     echo 'Indexing ' . $repo->id . "\n";
-    $idx->addRepo($repo, filectime($repo->gitDir));
+    $commits = $repo->getHistory();
+    $first = count($commits)-1;
+    $idx->addRepo($repo, $commits[$first]->committerTime, $commits[0]->committerTime);
 }
 ?>