| 1 | #!/usr/bin/php5 |
| 2 | <?php |
| 3 | require_once 'connect.db.inc.php'; |
| 4 | |
| 5 | $globals->debug = 0; //do not store backtraces |
| 6 | |
| 7 | $terms = XDB::iterator('SELECT `jtid`, `name` FROM `profile_job_term_enum`'); |
| 8 | while ($term = $terms->next()) { |
| 9 | $tokens = array_unique(JobTerms::tokenize($term['name'])); |
| 10 | if (!count($tokens)) { |
| 11 | continue; |
| 12 | } |
| 13 | $values = array(); |
| 14 | foreach ($tokens as $t) { |
| 15 | $values[] = '('.XDB::escape($t).','.XDB::escape($term['jtid']).')'; |
| 16 | } |
| 17 | XDB::execute('INSERT IGNORE INTO `profile_job_term_search` (`search`,`jtid`) VALUES '.implode(',',$values)); |
| 18 | } |
| 19 | |
| 20 | /* vim:set et sw=4 sts=4 ts=4: */ |
| 21 | ?> |