Skip to main content.
home | support | download

Back to List Archive

Re: modifiying results in the search.cgi page, using swish api

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Wed May 26 2004 - 18:59:22 GMT
On Wed, May 26, 2004 at 11:49:04AM -0700, Deepesh_Banerji@sybase.com wrote:
> while ( my $result = $results->NextResult ) {
>      my $doctitle = $result->Property( "swishtitle" );
>      $doctitle =~ s/SOME TEXT - / /g;  # Replace some piece of text from my
> titles
>      $result->Property( "swishtitle" ) = $doctitle;
> }
> 
> However, this doesn't work because in the last line, it doesn't let me edit
> the Property "swishtitle" directly. What method can I call to change that
> property?

Right, you can't set a property like that.

Which output module are you using?

It's really a display issue, so modify it in the template.  Are you
using Template Toolkit for output?  Then use a filter:

   [% item.swishtitle | replace('foo', 'bar' ) %]

http://www.template-toolkit.org/docs/plain/Manual/Filters.html#replace_search_replace_

Post back if you are using a TemplateDefault or HTML::Template, but in
both you want to modify it in the template.

-- 
Bill Moseley
moseley@hank.org
Received on Wed May 26 11:59:23 2004