Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Searching Problem?

Quote Reply
Searching Problem?
Simple fix for this I would assume?

Under Links 2.0 I could search "beoth" and find sites with "beothuk" etc... However in Links SQL I get no results unless I search the entire word "Beothuk".

Where and what do I modify to enable SQL version to search like in the first example?

Thanks in Advance!

Quote Reply
Re: Searching Problem? In reply to
Check the search.cgi

You want to set the default for the ww parameter to '0' rather than 1

ww stands for "whole word" and that is what Links SQL uses rather than the 'substring' parameter of Links 2.0



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: Searching Problem? In reply to
So if I am reading this right...

I change in search.cgi the following:

($in->param('substring')) ? ($ww = 0) : ($ww = 1);

to read this:

($in->param('substring')) ? ($ww = 1) : ($ww = 0);

Is this correct?

Quote Reply
Re: Searching Problem? In reply to
Actually, after the lines where it scans the $in->param items, (or at least after any of the lines with $ww in them)
add a line:

$ww = 0;

That will force substring searches no matter what was input, and it bypasses some problems of having to adjust all the templates, search boxes, etc.

It wastes a few assignments lines, but that is trivial in the larger scheme of things, and it's so easy to just force it 'off' at the end of the block of code.

If you change your mind later, and want to adjust all your templates to allow exact/partial searching, you can just delete that line, and things will work -- but you have to have the checkbox with default set, and set up the 'substring' parameter to be passed with each search..... Much easier to do it the way above <G>

Since substring search is infinitely more useful than exact-match,
most people will only notice the better searches :)





http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/