Skip to main content.
home | support | download

Back to List Archive

Re: Show rank score in percentage

From: Dominique Arpin <dominique(at)not-real.espacecourbe.com>
Date: Fri Aug 26 2005 - 13:33:53 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

Thanks, it works perfectly.  I will read the docs.  It will be a good
thing to add this links in the siwsh-e docs.



>
> --
> 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
>


-- 
Dominique Arpin_______________________[   Espace
administrateur réseau                     Courbe    ]
A+,Linux+,Server+,MCP                     http://www.espacecourbe.com/
                                          téléphone    514.933.9861
                                          télécopieur  514.933.9546
Received on Fri Aug 26 06:33:54 2005