Skip to main content.
home | support | download

Back to List Archive

Re: Show rank score in percentage

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri Aug 26 2005 - 13:10:11 GMT
On Fri, Aug 26, 2005 at 05:34:47AM -0700, Dominique Arpin wrote:
> > there is no config file option for this. I simple regex could probably do
> > the trick. Are you using swish.cgi or SWISH::API or ... ?
> 
> I use search.cgi

I think I can do this math.

Ok, search.cgi by default uses the template "search.tt" (normally in
$prefix/share/swish-e/templates).  Look for BLOCK display_results.

The rank displays here:

    [% item.Property('swishrank') %]

I suspect if you did something like

    [% item.Property('swishrank') / 10 %]

You would have your percent.


moseley@bumby:~$ perl -MTemplate -wle 'my $s="Rank [% rank / 10 %]%"; Template->new->process(\$s,{ rank => 345})'
Rank 34.5%

If you want more control over the printed format maybe see:

http://www.template-toolkit.org/docs/plain/Modules/Template/Plugin/Format.html

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Fri Aug 26 06:10:12 2005