[BETA] Rebuild Search Mod

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

[BETA] Rebuild Search Mod

Post by GUI »

This will index every post in your phpBB, rebuilding the search tables.

Download:
.tar.gz
.zip
Last edited by GUI on Fri Nov 14, 2003 2:47 am, edited 3 times in total.
Hard work may not kill you, but why take chances?
Sparkchaser
Registered User
Posts: 8
Joined: Sat Feb 22, 2003 3:46 am
Contact:

Post by Sparkchaser »

Great idea! Now if only I could figure out how to include the Smartor Photo Gallery in the search data.
If at first you don't succeed, stand back, have a drink, re-read the documentation, have another dring, study th code, have nuther drunk, clos 1 eye, try th other eye, have nuthr dunk, give up, blame smbdy else
DanielJarrett
Registered User
Posts: 425
Joined: Fri Dec 14, 2001 7:30 pm
Location: near Paris, France
Contact:

Post by DanielJarrett »

I haven't had time to download this mod, but could you explain how this mod is different to the phpBB one here:

http://cvs.sourceforge.net/cgi-bin/view ... cvs-markup
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

Post by GUI »

Well, I didn't know that little script existed. :|

After looking over that script, I guess the main benefit of mine is that it is compatible with safe-mode versions of PHP. That script just sets the maximum execution time to infinity, which causes problems if PHP is running in safe mode. Mine divides the execution into as many pages as needed. You can set a maximum time limit and a maximum number of posts to iterate. Which ever is reached first is what takes effect. After that limit is reached, a new page is displayed that gives you the progress and will then auto-refresh onto the next step. Mine will also dectect if PHP is running in safe mode, and if so, lower the execution time limit to whatever the PHP config is set to.

Plus mine is a spiffy little admin module. ;)
Hard work may not kill you, but why take chances?
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

GUI wrote: Plus mine is a spiffy little admin module. ;)

I already got this from somewhere... have to dig it up and find the original author. He had his written to update a set number at a time (default was 100, but could be changed). And it was also an admin module. ;-)

This, along with some other stuff, should be standard features in the new version, IMHO.

Dave
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

I don't say this all that often..... however:


GUI, kick-ass job on this!!


Much needed by many a people these days!
User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

:(

Post by Trinity »

I have tried to run this script, mainly because I have been having issues with my search engine (whenever I search it never finds anything).

However, as soon a I run it, I get this error message:

Code: Select all

Could not insert new word matches

DEBUG MODE

SQL Error : 1054 Unknown column 'single' in 'field list'

INSERT INTO phpbb_search_wordmatch (post_id, word_id, title_match) SELECT single, word_id, 0 FROM phpbb_search_wordlist WHERE word_text IN ('7007')

Line : 242
File : c:\program files\apache group\apache\htdocs\phpbb\includes\functions_search.php
Help!
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

Post by GUI »

Very strange. It appears as though it is somehow mixing up $mode with $post_id. Have you modified the functions_search.php file at all? Make sure the function declaration for the add_search_words function looks like this (found at or around line 100 in the includes/functions_search.php file):

Code: Select all

function add_search_words($mode, $post_id, $post_text, $post_title = '')
Hard work may not kill you, but why take chances?
User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

:)

Post by Trinity »

GUI wrote: Very strange. It appears as though it is somehow mixing up $mode with $post_id. Have you modified the functions_search.php file at all? Make sure the function declaration for the add_search_words function looks like this (found at or around line 100 in the includes/functions_search.php file):

Code: Select all

function add_search_words($mode, $post_id, $post_text, $post_title = '')


Very strange, indeed! I have not modified the functions_Search.php file whatsoever. I just happened to actually use the search function the other day and it didn't find anything, which, of course, sparked my curiosity. In any case, what you have proposed is exactly what I have in my functions_search.php file! :(
GUI
Registered User
Posts: 65
Joined: Sat May 25, 2002 3:21 pm
Location: The padded room
Contact:

Post by GUI »

Are you by any chance running phpBB on PostgreSQL?
Hard work may not kill you, but why take chances?
User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

Post by Trinity »

GUI wrote: Are you by any chance running phpBB on PostgreSQL?


No, I am using MYSQL.
User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

Post by Trinity »

Interstingly, I can search for Authors and I get results. It's only for words where I don't get any results. That is why I thought rebuilding the search index would be a good idea.
CMT
Registered User
Posts: 70
Joined: Sat Mar 01, 2003 2:34 am

Post by CMT »

I can't seem to run this script as it is to heavy on the server...

My board has:
Number of posts: 86473
Number of topics: 2919
Number of users: 1102


Rebuilding the search function took me 24 hours and I got to approx. 64% in that time. The database went from 90 mb to 180 mb (gzip compression ON)

Is there a way to speed this up and perhaps have not such a large searchword database?
chatasos
Registered User
Posts: 748
Joined: Wed May 15, 2002 1:16 pm
Location: Paralia

Post by chatasos »

Is there a way to make it stop?
A "cancel" button should be a nice addition :wink:
jtp10181
Registered User
Posts: 30
Joined: Wed Jan 23, 2002 3:56 am
Contact:

Post by jtp10181 »

I just tried it out and I dont see any problems so far...
I deleted a LOT of posts and I think there was a lot of junk left over so that helped me a lot, I was looking for something to do just this.

----
hmmm just tried it on a bigger board and it seems to crap out after a while and just stop...

and that other devel script keeps telling me "hackin attempt"
-----

Ok I'm a moron... i did not know what those boxes were for exactly... I set the post limit down to 100 and it seems to be doing 100 posts at a time which is working... yay I did not mess my boards search up forever :)

One thing though, the percent is not displaying.... here is what the source code of the "status" screen comes out loiking like:

Code: Select all

<body>

<a name="top"></a>


<br /><br />

<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline">
	<tr>
		<th class="thHead" align="center"></th>
	</tr>
	<tr>
		<td class="row1" width="100%" align="center"><span class="gen"></span></td>
	</tr>
</table>

<br />

<div align="center"><span class="copyright">Powered by phpBB 2.0.4 & 2001 <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB Group</a><br /></span></div>

</body>
</html>
I took out the junk on the top, my refresh is 3....
it doesn;t seem to be doing anything.... I looked at the template and it looks like it should work....

hmmm I did some digging and it looks like it is displaying the "admin_message_body.tpl" instead pf the status screen..... lets see if i can fix that....

admin_rebuild_search.php

Code: Select all

	$template->set_filenames(array(
		//"body" => "admin/admin_message_body.tpl")
		"body" => "admin/rebuild_search_progress.tpl")
		
	);
I have done that..... once this is done I will upload it and see if it works

also just a FYI you might want to put some infor on the page that tells people what the options are for... and also a cancel button if possible like that guy suggested...... even though that would be bad...
maybe theres a way to hit "pause" and then start where you left off or something.... I really don't know.....
Last edited by jtp10181 on Wed Mar 19, 2003 5:00 pm, edited 1 time in total.
FXP Tutorials: http://www.jtpfxp.net
HL Server Hosting: http://www.thekingpin.net
Post Reply

Return to “[2.0.x] MODs in Development”