Skip to main content.
home | support | download

Back to List Archive

Re: [swish-e] Change the indexed 'title'

From: <josh(at)>
Date: Thu Oct 25 2007 - 18:24:07 GMT
actually i mis-quoted what i need here... been playing with perl for a good hour now and can't seem to get it.

I am in the swish.cgi file - right where it defines the title_property: "title_property => 'swishtitle'," 

Its there I want to do a if/then statement.. I am sure the problem has something to do with comma's and/or semi-colons; but i tried every combination i could think of ;-)

Want something like what is below (keeping it to only a few things for testing):

If ('swishtitle' ne '') {
      title_property => 'swishtitle';
} elseif ('strong' ne '') {
      title_property => 'strong';
} else {
      title_property => 'swishdocpath';

Basically = if there is no title, then use strong as the title, and if there is no strong, then use the path as the title.....I know the 'strong' is populated because if i change the above mentioned line to "title_property => 'strong'," it works on my search queries.

...what am i missing here (be gentle, new to this brand of programming ;-P )



> wrote:
>>Now I just have to figure out how to do a 'if - then - else' string in perl 
>>(for example; if 'flavor' = 'whatever' use 'strong', elseif 'flavor' =
>'thisotherthing' use 'a', else use 'normal')
>my $str;
>if( $flavor eq 'whatever' ) {
>  $ans = 'strong';
>} elsif( $flavor eq 'flavor' ) {
>  $ans = 'a'
>} else {
>  $ans = 'normal';
>Michael Peters
>Plus Three, LP
>Users mailing list
Users mailing list
Received on Thu Oct 25 14:24:07 2007