Gossamer Forum
Home : Products : Gossamer Links : Discussions :

SearchCache plugin

Quote Reply
SearchCache plugin
How many of you people are using SearchCache plug in? Do you think it works well or does it actually slows your site down? Any feedback is appreciated! Wink
Quote Reply
Re: [flybuzz] SearchCache plugin In reply to
I tried it but did not see any difference so I removed it again.

Klaus

http://www.ameinfo.com
Quote Reply
Re: [flybuzz] SearchCache plugin In reply to
Hi,

It was created to cache the search results to speed up the search. If your Links data is "big", you can see the performace. Otherwise, it is not much diffirent

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] SearchCache plugin In reply to
I have 200,000 links in - but did not see any difference. I am using MYSQL4 which does the caching anyway - so perhaps that explains it...

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] SearchCache plugin In reply to
Ok. In this case, do you think caching one sql statement results is better than two/more? I mean If the CacheSearch query statement cached, it is faster too

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] SearchCache plugin In reply to
Hi,

Is this plugin meant to work on GLinks 3.2? I'm trying it on a large DB (5 million links), but I don't see any data getting put into the SearchCache table - so I'm guessing its not working?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
Hi Andy,

It is very old since I first submit to there. I did not updated it for latest glinks verions and don't know how to update that.

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [tandat] SearchCache plugin In reply to
Hi,

Ok =)

I'll have a look at writing one myself, as it doesn't seem to work on the new version, and its a feature I need :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [tandat] SearchCache plugin In reply to
Hi,

I'm getting there with fixing up your version.

The problem I'm having, is getting the values out of links_results_loop.

I've tried loads of stuff - but I'm not really 100% sure what format its actually in :/

doing a Dumper($args->{links_result_loop}) .. gives what I would expect ...i.e:
Code:
$VAR1 = [
{
..values for link 1
},
{
..values for link 2
},
{
..values for link 3
}
]

.. but the way I'm thinking its gonna have to work - is by doing something like:

1) Loop through links_results_loop - getting the links ID number, and saving them like 1,2,3,4,5 into the link_results field.
2) The, in query_cache(), get it to grab the Link ID's from the link_result table - and get each of the results (this is still gonna be a hell of a lot quicker than doing full searches for repeat queries).

The problem as I said - is I can't work out the syntax of getting out the values of the hashref's inside $args->{links_result_loop} Frown

BTW - the reason it wasn't adding the entries into the SearchCache table was because the "keyword" field was blank - $ENV{QUERY_STRING} was returning nothing, so I'm using this now to get the query string:

Code:
sub get_values {

my @input;
foreach my $key ($IN->param()) {
my $value = $IN->param($key);
push @input, "$key=$value";
}

return join("&",@input);

}

..and that seems to be working a treat Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
*bump*
Quote Reply
Re: [tandat] SearchCache plugin In reply to
Hi,

I've finally managed to rewrite this =)

There are a couple of functions that were in your original version;

Code:
reset_cache()
timeout()
build_reset_cache()

.. but the rest I've had to rewrite - as the way you were doing it, wasn't being liked in GLinks. I've also added some documentation, as it requires a couple of template changes (only 2)

The main reason it wasn't working, was that you were simply writing the results from <%links%> - which isn't supported in GLinks. The same with the category results - you had to actually store the category_results_loop, instead of just HTML. Its taken about 8 hours to get this far, but hopefully it'll all work fine for other users (seems to be running fine on my install of 4.5 million links)

Also , the "paging" bit was quite hard - as thats not returned as just text - so I had to use a bit of initiative on that one =)

Anyway, heres the new version.

Seeing as you wrote the original, I've left it with the same name - and given you create in the install / readme etc Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
Thanks!

That's good!

Cheers,

Cheers,

Dat

Programming and creating plugins and templates
Blog
Quote Reply
Re: [Andy] SearchCache plugin In reply to
Hi,

I've uploaded the new version onto our site:

http://www.ultranerds.com/...ns/SearchCache_L230/. The version in the GLinks Plugin Download area (i.e in your admin panels) will still be the old version by Dat, so that won't work with GLinks Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
Hi Andy
Thx a lot to have upgraded this nice plugin

But i have a small problem.
i'm using tag <%detailed_url%> on links.html

and with your plugin searchCache
i've got this error:

Unknown Tag: 'detailed_url'

thanks
Quote Reply
Re: [dujardin] SearchCache plugin In reply to
Hi,

Quote:
Thx a lot to have upgraded this nice plugin

No problem =)

In /admin/Plugins/SearchCache.pm, find:

Code:
push @links, $hit;

.. and add this line before it:

Code:
$hit->{detailed_url} = $CFG->{build_root_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} );

That should work :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
very fast reply Sly

it's working good with
Code:

$hit->{detailed_url} = $CFG->{build_detail_url} . "/" . $DB->table('Links')->detailed_url( $hit->{ID} );


another little error the tag
Code:
<%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%>

disappeared

There's no error but the text you are here -> "Search results"

doesn't display


thx

Last edited by:

dujardin: Apr 11, 2008, 10:09 AM
Quote Reply
Re: [dujardin] SearchCache plugin In reply to
Hi,

Quote:
another little error the tag
Code:
<%Links::Utils::format_title($main_title_loop, separator => $crumb_separator, no_escape_separator => $no_escape_crumb_separator, include_home => 1, link_type => 2)%>

disappeared

There's no error but the text you are here -> "Search results"

Try editing /admin/Plugins/SearchCache.pm, find:

Code:
print Links::SiteHTML::display('search_results', {
link_results_loop => \@links,
%$results,
dont_reprocess => 1
} );


..and change to:

Code:
my @crumb;
push @crumb, { Name => "Home", URL => qq|$CFG->{build_root_url}| };
push @crumb, { Name => "Search", URL => qq|$CFG->{db_cgi_url}/search.cgi| };
push @crumb, { Name => "Results", URL => qq|$CFG->{db_cgi_url}/search.cgi| }; # no need passing the keyword, as the last bit isn't ever shown =)


print Links::SiteHTML::display('search_results', {
link_results_loop => \@links,
%$results,
main_title_loop => \@crumb,
dont_reprocess => 1
} );

That should fix the problem :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [dujardin] SearchCache plugin In reply to
Hi,

I've just uploaded version 2.1.

http://www.ultranerds.com/...ns/SearchCache_L230/

This includes:

1) The detailed_url bug fix
2) The breadcrumb fix

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] SearchCache plugin In reply to
Hi Andy, I know that this an old plug- but I will trySmile
Every time that the plug save the result of a query it create a new column in the database, can you manage that it will update a column if it already exist?
Quote Reply
Re: [nir] SearchCache plugin In reply to
Hi,

Not sure I understand? The plugin should only put a new value into the SearchCache table if one doesn't exist for that query. The table should get cleaned out after the xx timescale (the "timeout") ... so there should only ever be one entry in there per search phrase?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!