95 |
$s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/; |
$s=~tr/¹©ðÐèÈæƾ®/sSdDcCcCzZ/; |
96 |
$s=~s/\*\*+/*/g; |
$s=~s/\*\*+/*/g; |
97 |
|
|
98 |
|
my %params; # optional parametars for swish |
99 |
|
|
100 |
|
my @properties = split(/\s+/,x($config->{properties})); |
101 |
|
$params{properties} = \@properties if (@properties); |
102 |
|
|
103 |
my $sh = SWISH->connect('Fork', |
my $sh = SWISH->connect('Fork', |
104 |
prog => x($config->{prog}), |
prog => x($config->{prog}), |
105 |
indexes => x($config->{index}), |
indexes => x($config->{index}), |
|
# properties => [qw/god br nr/], |
|
106 |
results => sub { |
results => sub { |
107 |
my ($sh,$hit) = @_; |
my ($sh,$hit) = @_; |
108 |
|
|
109 |
|
my $hit_fmt = x($config->{hit}) || |
110 |
|
"<a href=\"%s\">%s</a> [%s]<br>\n"; |
111 |
|
|
112 |
if ($config->{url}) { |
if ($config->{url}) { |
113 |
printf ("<a href=\"%s\">%s</a> [%s]<br>\n","http://".virtual_host().x($config->{url}).$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank); |
printf ($hit_fmt ,"http://".virtual_host().x($config->{url}).$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank); |
114 |
} else { |
} else { |
115 |
printf ("<a href=\"%s\">%s</a> [%s]<br>\n",$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank); |
printf ($hit_fmt ,$hit->swishdocpath,$hit->swishtitle || 'untitled',$hit->swishrank, map($hit->$_, @properties) ); |
116 |
|
|
117 |
} |
} |
118 |
|
|
121 |
# print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields; |
# print "Field '$_' = '", $hit->$_, "'<br>\n" for sort @fields; |
122 |
}, |
}, |
123 |
maxhits => param('max_hits') || $max_hits, |
maxhits => param('max_hits') || $max_hits, |
124 |
|
\%params, |
125 |
); |
); |
126 |
|
|
127 |
die $SWISH::errstr unless $sh; |
die $SWISH::errstr unless $sh; |