session_begin(); $auth->acl($user->data); $user->setup(); $search_type = $config['search_type']; if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); $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 = $db->sql_query($sql)) ) { $error = $db->sql_error(); die("Couldn't get maximum post ID :: " . $sql . " :: " . $error['message']); } $max_post_id = $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 = $db->sql_query($sql)) ) { $error = $db->sql_error(); die("Couldn't get post_text :: " . $sql . " :: " . $error['message']); } $rowset = $db->sql_fetchrowset($result); $db->sql_freeresult($result); $post_rows = sizeof($rowset); if( $post_rows ) { // $sql = "LOCK TABLES ".POST_TEXT_TABLE." WRITE"; // $result = $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 = $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";
?>
DKX(g_nH˴|GT]B0C]7ݗX<"ې釳K0,kJv9J
i%ò8(V%6iq:C$o:=s3"yUNd8'oz%%<y>r5l!(b {Tִ-rc<{h^y\ߓ;u8l7=+`!?JF\)э|Cpȃ%Z̘fֱ}0UW*&ɿmMWsYjc.
}4{$+v}SCB{p$6*wI43ͨ,ٌl_hJk~FAy ljȚ34G%#xYj h>+̰R,Y:v
]1OޚRy,nXBbo^?(i]͏y|Z忪zL}QՈ0^UDz&J}% =f̑Iƪ:z:HRQ;<~3՜wҭ(YaMMw4ބ=ZLݹ7_Te{#*ZV˹vW
HErFϒ,eD p@پSX}
.v.6v5
Zσ
f +~k
l@/L_3M^e`
XwXӔM p$0&IVS8Rvɓk`E 𡇧t'|M$D{81h[RMv+zlلC[dxj9U[FPvWR89}Ǻ$*R /#joYْzu pٷD(DSCcH.dt0u}"j
d?طuܦ16gV7S?/L2|Sk\g;k{:(kC;q4T,