PDA

View Full Version : Indexing one page at a time


synnalagma
03-30-2004, 01:02 AM
Hi,

I'm doing a website with a big document database. I want index this documents (mainly pdf).

I have an interface to add documents to the database and what I want is to index the document at this time.

The problem i have is that there's a time limit on the server. I have written a php script that link and indexed it but after some times it reindex all document wich take too much time.

So i think the solution would be to index or reindex documents only when I know that there are added or modified.

Is there a function I can use to index (or reindex) a specific document ?

Thanks for your help and sorry for my poor english.

Charter
03-30-2004, 08:05 AM
Hi. Perhaps try the following.

In spider.php find:

if ($mode != 'small') {
$query_tempspider = "INSERT INTO ".PHPDIG_DB_PREFIX."tempspider (site_id,file,path) SELECT site_id,file,path FROM ".PHPDIG_DB_PREFIX."spider WHERE site_id=$site_id $andmore_tempspider";
mysql_query($query_tempspider,$id_connect);
}
else {
$force_first_reindex = 1;
}

and replace with:

if ($mode != 'small') {
/*
$query_tempspider = "INSERT INTO ".PHPDIG_DB_PREFIX."tempspider (site_id,file,path) SELECT site_id,file,path FROM ".PHPDIG_DB_PREFIX."spider WHERE site_id=$site_id $andmore_tempspider";
mysql_query($query_tempspider,$id_connect);
*/
}
else {
$force_first_reindex = 1;
}

Remember to remove any "word" wrapping in the above code.

synnalagma
03-30-2004, 11:47 PM
Thanks for your fast reply.

Just another question.

Is there a function I can use like
spider($url)
or
spider($file)
or
startIndexing($url)
or
startIndexing($file)

To automate indexing only one file.

Thanks in advance

Charter
03-31-2004, 11:52 PM
Hi. There is no such option currently available.