Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Problem with spider search results.

Quote Reply
Problem with spider search results.
At present, the only way that the spider results will show up is if there are absolutely no results in the main database (or if the main DB is completely bypassed). Is there a way to show the spider results if say only a handful of links in the main DB is found?

It seems an awful waste for the spider database to be completely forgotten when only 3 links might be found in the main database. I think the search results should be integrated more effectively. Alternatively, if there are a few pages of results in the main DB, the user should have the option of also checking the spider DB for more results once they reach the last page of the main DB results.

Thx



Rob Bartlett
AAA Internet Publishing, Inc.
http://www.AAAInternet.com
Quote Reply
Re: Problem with spider search results. In reply to
Hi,

If you pass in spider=1 to the search.cgi, it will search the spider database and make those results available as template tags.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Problem with spider search results. In reply to
Alex, is this what you mean?:

<input type="hidden" name="spider" value="1">

From reading your help file, it sounds like this will completely bypass the search results for the main database, which isn't what I want. Or am I not understanding the help file properly? I want to be able to show both results at the same time, as described in my previous post.

It doesn't seem logical to only search the spider database if there are absolutely no results in the main links database. Ideally, the spider results should automatically be shown if fewer than a screenful of links from the main DB is shown, or if the last page of links from the main DB is shown. Is this currently possible?

Thx


Rob Bartlett
AAA Internet Publishing, Inc.
http://www.AAAInternet.com
Quote Reply
Re: Problem with spider search results. In reply to
No, you would need to make a minor change. If you edit Spider.pm around line 113:

return @_ if ( $results->{category_hits} or $results->{link_hits} );

to:

Code:
$results->{category_hits} ||= 0;
$results->{link_hits} ||= 0;
return @_ if ($results->{link_hits} + $results->{category_hits} > 1000);
The 1000 is how many hits you need to get to not trigger the spider. So if your search term was so common that there were 1000 entries in your directory, then no point doing a spider search.

Let me know if that helps,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Problem with spider search results. In reply to
* - Found the problem, just had to replace @_ with $results

Looks like this should probably do the trick, still don't see the spider results of the same page, but better than before. =)

Thx

Rob Bartlett
AAA Internet Publishing, Inc.
http://www.AAAInternet.com