From bf8ac19eaa8d74f9dfd6d597190f5664e7339382 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 4 Oct 2009 18:13:59 +0000 Subject: Move trunk/phpBB to old_trunk/phpBB git-svn-id: file:///svn/phpbb/trunk@10210 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 129 ------------------------------------------ 1 file changed, 129 deletions(-) delete mode 100644 phpBB/develop/search_fill.php (limited to 'phpBB/develop/search_fill.php') diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php deleted file mode 100644 index 8819c428fd..0000000000 --- a/phpBB/develop/search_fill.php +++ /dev/null @@ -1,129 +0,0 @@ -session_begin(); -phpbb::$acl->init(phpbb::$user->data); -phpbb::$user->setup(); - -$search_type = phpbb::$config['search_type']; - -if (!file_exists(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT)) -{ - trigger_error('NO_SUCH_SEARCH_MODULE'); -} - -require(PHPBB_ROOT_PATH . 'includes/search/' . $search_type . '.' . PHP_EXT); - -$error = false; -$search = new $search_type($error); - -if ($error) -{ - trigger_error($error); -} - -print "\n\n"; - -// -// Fetch a batch of posts_text entries -// -$sql = "SELECT COUNT(*) as total, MAX(post_id) as max_post_id - FROM ". POSTS_TABLE; -if ( !($result = phpbb::$db->sql_query($sql)) ) -{ - $error = phpbb::$db->sql_error(); - die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']); -} - -$max_post_id = phpbb::$db->sql_fetchrow($result); - -$totalposts = $max_post_id['total']; -$max_post_id = $max_post_id['max_post_id']; - -$postcounter = (!isset($HTTP_GET_VARS['batchstart'])) ? 0 : $HTTP_GET_VARS['batchstart']; - -$batchsize = 200; // Process this many posts per loop -$batchcount = 0; -for(;$postcounter <= $max_post_id; $postcounter += $batchsize) -{ - $batchstart = $postcounter + 1; - $batchend = $postcounter + $batchsize; - $batchcount++; - - $sql = "SELECT * - FROM " . POSTS_TABLE . " - WHERE post_id - BETWEEN $batchstart - AND $batchend"; - if( !($result = phpbb::$db->sql_query($sql)) ) - { - $error = phpbb::$db->sql_error(); - die("Couldn't get post_text :: " . $sql . " :: " . $error['message']); - } - - $rowset = phpbb::$db->sql_fetchrowset($result); - phpbb::$db->sql_freeresult($result); - - $post_rows = sizeof($rowset); - - if( $post_rows ) - { - - // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE"; - // $result = phpbb::$db->sql_query($sql); - print "\n

\nRestart from posting $batchstart
\n"; - - // For every post in the batch: - for($post_nr = 0; $post_nr < $post_rows; $post_nr++ ) - { - print "."; - flush(); - - $post_id = $rowset[$post_nr]['post_id']; - - $search->index('post', $rowset[$post_nr]['post_id'], $rowset[$post_nr]['post_text'], $rowset[$post_nr]['post_subject'], $rowset[$post_nr]['poster_id']); - } - // $sql = "UNLOCK TABLES"; - // $result = phpbb::$db->sql_query($sql); - - } -} - -print "
Removing common words (words that appear in more than 50% of the posts)
\n"; -flush(); -$search->tidy(); -print "Removed words that where too common.
"; - -echo "
Done"; - -?> - - - -- cgit v1.2.1