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

Still search problems in 1.13

Quote Reply
Still search problems in 1.13
I have upgraded my test site to Links SQL 1.13, but after the upgrade I found problems searching substring:
I have an example. Searching leo should find one link having Leo in the title. Searching leo* should find two links: Leo and Leonia in the title, but doesn't find Leonia. I have enabled DEBUG on level 5, but I can't understand what goes wrong. Please could someone check my site with the following examples:

URL: http://www2.fimnet.fi/cgi/links/search.cgi (version 1.13) or search11.cgi (version 1.11 search.cgi)
Search for word "leo" and you should find: "Leo Pharma Oy"
Search for word "leo*" and you should find: "Leo Pharma Oy" and "Leonia pankki"

I have upgraded both search.cgi and Search.pm from 1.11 to 1.13.

Lauri Parikka

Quote Reply
Re: Still search problems in 1.13 In reply to
Hello,

I did a search on your page with search term leo, and I clicked on Merkkejä, to change to substring searching, and
I retrieved both leo and leonia.



Jian Liu
Indiana University Libraries
Quote Reply
Re: Still search problems in 1.13 In reply to
Looking at the debug output on your site, the Category search statement is - WHERE Word like "%leo%". AFAIK the "%leo%" looks for 'leo' in any part of the field, the %'s denoting anything can go either before or after, so it would bring up anything containing 'leo'.

However, further down the debug the Links search statement is - WHERE Word = "leo" - which will only return links based on 'leo' at the start of the field, i.e.; where field equals 'leo'. This might explain why you're not getting the results you expect.

Have you made any other changes to Search.pm or DBSQL.pm or DB_Utils.pm recently apart from the 1.13 upgrade?

Also, in search.cgi the variable that sets up a substring search is $ww - you'll find it amongst the settings in # Get/Set the search options. It should read something like this:

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

You can force the substring setting by adding either of the following lines after the search options:

$ww = 0; # Turn OFF substring for ALL searches
$ww = 1; # Turn ON substring for ALL searches

Another line to check in search.cgi is this one:

$link_hits = $linkdb->query ( { query => $query, mh => $mh, nh => $nh, filter => \%filter, ww => $ww, ma => $bool }

... make sure you've got the $ww setting in place or the substring value won't be passed to the search routine.

Sorry for the long post ... hope this helps Smile

All the best
Shaun

Quote Reply
Re: Still search problems in 1.13 In reply to
I understand that I could change $ww to default to 1, BUT shouldn't the * in the searchstring force the search to do substring search instead of whole word search? I thought the search should work throught the normal search-field so that "leo" would search only words "leo" and the star (*) in "leo*" should force the search to make substring search for words starting with "leo" and finding both "leo" and "leonia".

Lauri

Quote Reply
Re: Still search problems in 1.13 In reply to
I don't believe that the search engine supports wild characters (*).

Regards,

Eliot Lee

Quote Reply
Re: Still search problems in 1.13 In reply to
lpa,

If you look at the debug of the Links search statement, you'll see that it is NOT doing a substring search (I think we already know that Smile), but since it's doing the substring search for the categories I feel it should also be doing it for the links.

You could try replacing your current Search.pm, DBSQL.pm, DB_Utils.pm and search.cgi files with the original ones, one at a time to see if it resets the substring search. That might help to pin-down the problem to a specific file. I'm not at my regular machine so I can't look at the code right now, but let me know if replacing any of the files worked.

All the best
Shaun