Dragonfly CMS v9 ⇒ CPG-BB (forum) ⇒ ForumsPro - rebuilding wordlist and wordmatch tables ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

ForumsPro - rebuilding wordlist and wordmatch tables Reply to topic


Extracted from an older post I provided.
<?php include('includes/cmsinit.inc'); global $db, $prefix; define('IN_PHPBB', true); define('SEARCH_WORD_TABLE', $prefix.'_bbsearch_wordlist'); define('SEARCH_MATCH_TABLE', $prefix.'_bbsearch_wordmatch'); include('includes/phpBB/functions_search.php'); $sql = "SELECT post_id, post_text, post_subject FROM {$prefix}_bbposts_text ORDER BY post_id ASC"; $result = $db->sql_query($sql); $total_topics = 0; while($row = $db->sql_fetchrow($result)) { add_search_words('global', $row['post_id'], $row['post_text'], $row['post_subject']); $total_topics++; } echo "Finished $total_topics topics - please delete this file"; I emphasize these qualifiers:
  • Place your website into Maintenance mode.


  • Backup all your cms_bb* tables first, since it seems some people don't.


  • Your cms_bbsearch_wordlist and cms_bbsearch_wordmatch must be empty to start with.


  • Place the code into a file and name it something obscure and upload to your DF root directory.


  • Run it once only - twice will double the results - ensure you delete when finished.


  • Check your forums and search are working correctly.


  • Don't throw away your backup, just in case Smile


  • Large databases may timeout.
    (you may want to test on a duplicate database/website first)

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are UTC


Jump to: