Welcome! Log In Create A New Profile


Reindex with erase

Posted by Tec 
Reindex with erase
May 19, 2007 08:14AM
Sphider's Reindex detects MD5 checksum changes at the sites you indexed before. But it dosn't recocnize changes you did in admin section. In order to solve this, here is a solution truncating the required tables of your database before reindexing.

Install a new script into folder ./admin/ which is called erase.php with the following content:

<!-- Start of erase.php -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="admin.css" type="text/css" />

include "auth.php";
$settings_dir = "../settings";
include "$settings_dir/conf.php";

$erase =array ("domains","keywords","links","link_keyword0","link_keyword1","link_keyword2","link_keyword3","link_keyword4","link_keyword5","link_keyword6","link_keyword7","link_keyword8","link_keyword9","link_keyworda","link_keywordb","link_keywordc","link_keywordd","link_keyworde","link_keywordf","pending"winking smiley;
foreach ($erase as $allthis){
mysql_query ("TRUNCATE `".$mysql_table_prefix."$allthis`"winking smiley;
echo mysql_error();

print "<br>Erasing done<br><br>";

<a href='spider.php?all=1'><br>Okay, now reindex all<br><br></a>
<a href='admin.php'><br>Return to admin without reindex</a>
<!-- End of erase.php -->

Now open /admin/admin.php and search for:

<li><a href='spider.php?all=1'>Reindex all</a><br><br></li>

After this, place a new row with this content:

<li><a href='erase.php'>Reindex all with erase</a><br><br></li>

Ready. In admin section "Sites" now you will find a new item called "Reindex with erase". Use this to do an index after you changed admin settings.

Anonymous User
Re: Reindex with erase
June 13, 2007 01:10AM
Re: Reindex with erase
January 25, 2008 08:49PM
Re: Reindex with erase
December 19, 2008 09:25AM
I don't understand how this mod will treat the database. The size of my database is more than 400 mb, so I'm a bit scared to mess up this.

If you choose "Reindex all with erase" the tables will be emptied, therefore 400 mb gone?
Re: Reindex with erase
December 19, 2008 10:06AM
Yes, it'll empty all the tables except for the ones containing the site(s).
Re: Reindex with erase
December 19, 2008 10:46AM
Also table contents of 'categories' and 'query log' remain untouched.

Re: Reindex with erase
December 19, 2008 12:21PM
ok. thanks for the info, Tec. reindexing with erase is like a couple days of work in my case.

Edited 1 time(s). Last edit at 12/19/2008 12:22PM by Willdk.
Re: Reindex with erase
December 19, 2008 01:16PM
Site individual 'Erase & Re-index' is enabled by Sphider-plus

Re: Reindex with erase
April 06, 2010 04:59PM
I hate to bring up an old topic, but looking at the code, there's smileys in it which I doubt is syntactically correct.

Instead of the smiley, what goes there, just a "winking smiley" ?

I'm not really sure and I don't want to go corrupting my databases on a guess,

thanks to anyone who catches this,
Re: Reindex with erase
April 06, 2010 05:49PM
replace it with a
Re: Reindex with erase
April 06, 2010 06:28PM
great, thanks for the quick reply,

I just ran the reindexing, and my computer didn't blow up,

Sorry, only registered users may post in this forum.

Click here to login