Welcome! Log In Create A New Profile

Advanced

Reindex with erase

Posted by Tec 
Tec
Reindex with erase
May 19, 2007 05: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 -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="admin.css" type="text/css" />
</head>
<body>
<?

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>
</body>
</html>
<!-- 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.

Tec
Anonymous User
Re: Reindex with erase
June 12, 2007 10:10PM
Excellent.
Re: Reindex with erase
January 25, 2008 06:49PM
Thanks
Re: Reindex with erase
December 19, 2008 07: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 08:06AM
Yes, it'll empty all the tables except for the ones containing the site(s).
Tec
Re: Reindex with erase
December 19, 2008 08:46AM
Also table contents of 'categories' and 'query log' remain untouched.

Tec
Re: Reindex with erase
December 19, 2008 10:21AM
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 10:22AM by Willdk.
Tec
Re: Reindex with erase
December 19, 2008 11:16AM
Site individual 'Erase & Re-index' is enabled by Sphider-plus

Tec
Re: Reindex with erase
April 06, 2010 01: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 02:49PM
replace it with a
)
Re: Reindex with erase
April 06, 2010 03:28PM
great, thanks for the quick reply,

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


thanks,
Sorry, only registered users may post in this forum.

Click here to login