i was facing the same issue i have 700,000 posts and always get time out and i had to start from the begining so idecided to do something
i have customoze the script to make it resume from where it was finished not from the start
so if ht escript timedout at post id = 50,000 next time it will start feom post id = 50,001
do make that happen you must do th follwing
- in your PHPmyadin
- choose the datbase
- choose qa_options
- click insert
- and add this to the title reindex_lastpostid
- open this file qa-include\app\recalc.php
- and from line 129 which start with case 'doreindexcontent_postreindex':
- to line 148 contains $continue=true;
- replace with this code
case 'doreindexcontent_postreindex':
$next = qa_opt('reindex_lastpostid');
$posts=qa_db_posts_get_for_reindexing($next, 100);
if (count($posts)) {
require_once QA_INCLUDE_DIR.'app/format.php';
$lastpostid=max(array_keys($posts));
qa_db_prepare_for_reindexing($next, $lastpostid);
qa_suspend_update_counts();
foreach ($posts as $postid => $post) {
qa_post_unindex($postid);
qa_post_index($postid, $post['type'], $post['questionid'], $post['parentid'], $post['title'], $post['content'],
$post['format'], qa_viewer_text($post['content'], $post['format']), $post['tags'], $post['categoryid']);
}
$next=1+$lastpostid;
qa_opt('reindex_lastpostid', $next);
$done = qa_db_count_rest_of_posts($next);
$continue=true;
and open file qa-include\db\recalc.php
and add this to the end
function qa_db_count_rest_of_posts()
{
@$next_post_id = qa_opt('reindex_lastpostid');
return qa_db_read_one_value(qa_db_query_sub(
'SELECT COUNT(*) FROM qa_posts WHERE postid < #',
$next_post_id
));
}
when you upgrade make sure you edit these 2 files
i hope if someone can create a plugin instead of that custome code it will be greate