|
07-19-2005, 05:53 PM | #1 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Slight problem with results.
Hi Charter & Everyone,
I am having a problem with the results that are displayed, when a search is carried out some results come back blank: I have checked to see if any files in the DB are of zero file length, and have run the PHP Admin cleaner a few times but I can't seem to get rid of these blank results coming through. Any ideas my friend? 1. [100.00 %] limit to 2. [95.26 %] limit to 3. [43.03 %] limit to 4. [40.82 %] limit to 5. [40.82 %] limit to |
07-23-2005, 12:32 PM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Does this happen when you do an exact search?
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
07-23-2005, 03:37 PM | #3 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Hi Charter, yes even an exact search produces a few 100% results with no text or domain details in the results.
And or searches produce even more of those empty results.. |
07-23-2005, 05:34 PM | #4 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Something got out of sync. Maybe info was deleted from the database directly instead of from the admin panel?
Try the following. First create the following table in the same database as the PhpDig tables: Code:
CREATE TABLE blanks ( blank TEXT DEFAULT '' NOT NULL ); Code:
$query = "SELECT sites.site_url, sites.port, spider.path,spider.file,spider.first_words,sites.site_id,spider.spider_id,spider.last_modified,spider.md5 " ."FROM ".PHPDIG_DB_PREFIX."spider AS spider, ".PHPDIG_DB_PREFIX."sites AS sites " ."WHERE spider.spider_id=$spider_id AND sites.site_id = spider.site_id"; $result = mysql_query($query,$id_connect); $content = mysql_fetch_array($result,MYSQL_ASSOC); Code:
if (empty($content['site_url'])) { $blank = addslashes(serialize($content)); mysql_query("INSERT INTO blanks (blank) VALUES ('$blank')",$id_connect); }
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
08-02-2005, 10:19 PM | #5 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Huston we have a problem?
Hi Charter, I have made the table in the database, copied the code over to the searchfunction.php file
When I do a few searches the results still show blank results but the table in the database would appear to be empty when I go there and look using phpmyadmin So I am not really sure what is happening the blanks table remains empty? I would appreciate your help if possible with this. Heaps of regards Dave A |
08-03-2005, 08:30 AM | #6 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Okay, now try the following...
First create the following table in the same database as the PhpDig tables: Code:
CREATE TABLE blanks2 ( blank TEXT DEFAULT '' NOT NULL ); Code:
$timer->stop('reorder results'); Code:
if (is_array($final_result) && count($final_result) > 0) { arsort($final_result); reset($final_result); while (list($spider_id,$weight) = each($final_result)) { $content_file = $relative_script_path.'/'.TEXT_CONTENT_PATH.$spider_id.'.txt'; if (!is_file($content_file)) { mysql_query("INSERT INTO blanks2 (blank) VALUES ($spider_id)",$id_connect); if (isset($final_result[$spider_id])) { unset($final_result[$spider_id]); } } } } Also note that this may seem like it removes the blanks, but it's a temporary thing. I'll need to see if any rows get inserted into blanks2 to put things back in sync.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
08-03-2005, 06:24 PM | #7 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Answers to post
Hi Charter,
I have added the blank2 table and copied the code as you have mentioned into the searchfunction.php file The results appear to be the same, after about thirty searches both the original blank table and the blank2 table are empty when I use phpmyadmin to have a look at them. Some of the results are still coming up with blanks that are empty and I didn't notice any change in search speeds. Perhaps this can help your diagnostics my friend?? All the best Dave A downunder |
08-03-2005, 07:33 PM | #8 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Hmm, try the following...
First create the following table in the same database as the PhpDig tables: Code:
CREATE TABLE blanks3 ( blank TEXT DEFAULT '' NOT NULL ); Code:
$query = "SELECT sites.site_url, sites.port, spider.path,spider.file,spider.first_words,sites.site_id,spider.spider_id,spider.last_modified,spider.md5 " ."FROM ".PHPDIG_DB_PREFIX."spider AS spider, ".PHPDIG_DB_PREFIX."sites AS sites " ."WHERE spider.spider_id=$spider_id AND sites.site_id = spider.site_id"; $result = mysql_query($query,$id_connect); $content = mysql_fetch_array($result,MYSQL_ASSOC); Code:
$blank = addslashes(serialize($content)); mysql_query("INSERT INTO blanks3 (blank) VALUES ('$blank')",$id_connect);
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
08-03-2005, 07:48 PM | #9 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Hi Charter I have just done that and when I completed the search, the blank3 table was empty.
|
08-03-2005, 07:49 PM | #10 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Email me FTP access to the PhpDig directory, if you will.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
08-03-2005, 08:05 PM | #11 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Hi Charter
just fired the access and password over to you. |
08-03-2005, 08:49 PM | #12 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Okay, the issue is that (a) the site_id column of the sites table contains IDs that are not in the site_id column of the spider table, (b) the site_id column of the spider table contains IDs that are not in the site_id column of the sites table, or (c) a combination of (a) and (b) so what I did was change the following query:
Code:
$query = "SELECT spider.spider_id,sum(weight) as weight, spider.site_id FROM ".PHPDIG_DB_PREFIX."keywords as k,".PHPDIG_DB_PREFIX."engine as engine, ".PHPDIG_DB_PREFIX."spider as spider WHERE engine.key_id = k.key_id ".$kconds[$n]." AND engine.spider_id = spider.spider_id $wheresite $wherepath GROUP BY spider.spider_id,spider.site_id "; Code:
$query = "SELECT spider.spider_id,sum(weight) as weight, spider.site_id FROM ".PHPDIG_DB_PREFIX."keywords as k,".PHPDIG_DB_PREFIX."engine as engine, ".PHPDIG_DB_PREFIX."spider as spider, ".PHPDIG_DB_PREFIX."sites as sites WHERE engine.key_id = k.key_id ".$kconds[$n]." AND sites.site_id = spider.site_id AND engine.spider_id = spider.spider_id $wheresite $wherepath GROUP BY spider.spider_id,spider.site_id ";
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
08-05-2005, 02:21 PM | #13 |
Purple Mole
Join Date: Aug 2004
Location: North Island New Zealand
Posts: 170
|
Hi Charter,
thanks for your advice and help with the problem, it appears to be okay now. I went into the phpmyadmin and check the sites table which showed an error because of zero length in site. ID part of the table, so I then tried to repair the table which failed to work it out. In the end I deleted all sit id's with a zero length and the sites table cleaned itself straight away. So now it's up and running sweet as. Thanks for your great help and assistance with this, I know it's not a given that you will sort out users problems but in this case I would really like say thanks! The whole engine is working, I can now clean the index brilliant help. Thanks for the support.. |
08-07-2005, 07:11 AM | #14 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Glad it is now working. BTW, what do you get from the following query?
Code:
SELECT count(*),max(site_id) FROM sites; Code:
site_id mediumint(9) NOT NULL auto_increment Hmm...
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search results layer problem | josuah08 | Troubleshooting | 1 | 02-17-2006 01:36 AM |
Problem Mysql when no results | noel | Troubleshooting | 4 | 10-27-2005 10:56 AM |
No most searched terms, biggest results, most 0 results, last search queries, etc. | jongag1 | How-to Forum | 6 | 04-22-2005 11:43 AM |
Problem restricting search results | Grenville Hamly | How-to Forum | 6 | 10-14-2004 06:19 PM |
problem with results | marchelly | Troubleshooting | 1 | 09-11-2004 07:14 AM |