20 |
|
|
21 |
my $from_utf8 = Text::Iconv->new('UTF8', $config->{charset}); |
my $from_utf8 = Text::Iconv->new('UTF8', $config->{charset}); |
22 |
sub x { |
sub x { |
23 |
|
return if (! defined $_[0]); |
24 |
return $from_utf8->convert($_[0]); |
return $from_utf8->convert($_[0]); |
25 |
} |
} |
26 |
|
|
72 |
$path_label{$_->{limit}} = x($_->{content}); |
$path_label{$_->{limit}} = x($_->{content}); |
73 |
} |
} |
74 |
|
|
75 |
my @properties = split(/\s+/,x($config->{properties})); |
my @properties = split(/\s+/,x($config->{properties})) if ($config->{properties}); |
76 |
|
|
77 |
if ($config->{charset}) { |
if ($config->{charset}) { |
78 |
print header(-charset=>x($config->{charset})); |
print header(-charset=>x($config->{charset})); |
259 |
} |
} |
260 |
} |
} |
261 |
|
|
262 |
|
my $title = e($result->Property("swishtitle")) || 'untitled'; |
263 |
|
my $rank = $result->Property("swishrank"); |
264 |
|
my $host = $result->Property("swishdocpath"); |
265 |
|
$host = "http://".virtual_host().x($config->{url}).$result->Property("swishdocpath") if ($config->{url}); |
266 |
print $tr_pre,$i,". "; |
print $tr_pre,$i,". "; |
267 |
if ($config->{url}) { |
# print collection name which is not link |
268 |
printf($hit_fmt, "http://".virtual_host().x($config->{url}).$result->Property("swishdocpath"), |
if ($title =~ s/^(.+? :: )//) { |
269 |
e($result->Property("swishtitle")) || 'untitled', |
print $1; |
|
$result->Property("swishrank"), |
|
|
@arr); |
|
|
} else { |
|
|
printf($hit_fmt, $result->Property("swishdocpath"), |
|
|
e($result->Property("swishtitle")) || 'untitled', |
|
|
$result->Property("swishrank"), |
|
|
@arr); |
|
270 |
} |
} |
271 |
|
printf($hit_fmt, $host, $title || 'untitled', $rank, @arr); |
272 |
print $tr_post; |
print $tr_post; |
273 |
|
|
274 |
} |
} |