This bit me as well.
BTW of the two possible solutions for this:
1. This one -
https://coderanch.com/t/578196 #19543,
2. This one -
http://www.andowson.com/trac/jforum/ticket/6
The first one is way faster in all of my
testing but it looks like the second solution is "preferred." Any idea why?
I've also found a secondary bug which is that if your first topic_id is > 50 then reindexing fails unless you set the start_Id as 50. The reason is because the code looks for posts in batches of 50. If the first one (1-50) returns no rows is exits without indicating a problem. Fix would be to change the firstPostId such that it gets the min ID from the jforum_topics table and if the number is higher than the user provided one uses that number.
[originally posted on jforum.net by chhum]