22 |
my $MAX_HITS = 500; |
my $MAX_HITS = 500; |
23 |
my $ON_PAGE = 10; |
my $ON_PAGE = 10; |
24 |
|
|
25 |
Text::Iconv->raise_error(1); # Conversion errors raise exceptions |
Text::Iconv->raise_error(0); # Conversion errors raise exceptions |
26 |
|
|
27 |
my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET); |
my $from_utf8 = Text::Iconv->new('UTF8', $CHARSET); |
28 |
|
|
91 |
$s.="$_* "; |
$s.="$_* "; |
92 |
} |
} |
93 |
} |
} |
94 |
|
$s =~ s/\*+/*/g; |
95 |
|
|
96 |
push @s_arr,$q->param("f$i")."_swish=($s)"; |
push @s_arr,$q->param("f$i")."_swish=($s)"; |
97 |
} |
} |
109 |
push @swish_results, { |
push @swish_results, { |
110 |
nr => ($#swish_results + 2), |
nr => ($#swish_results + 2), |
111 |
path => $hit->swishdocpath, |
path => $hit->swishdocpath, |
112 |
headline => $from_utf8->convert($hit->headline), |
# headline => $from_utf8->convert($hit->headline), |
113 |
html => back2html($from_utf8->convert($hit->html)), |
# html => back2html($from_utf8->convert($hit->html)), |
114 |
|
headline => $hit->headline, |
115 |
|
html => back2html($hit->html), |
116 |
rank => $hit->swishrank }; |
rank => $hit->swishrank }; |
117 |
|
|
118 |
}, |
}, |
194 |
$tmpl->param('limit',$limit); |
$tmpl->param('limit',$limit); |
195 |
$tmpl->param('total',$total); |
$tmpl->param('total',$total); |
196 |
|
|
197 |
|
# FIX: I should set offset and leave out limit from fetch!! |
198 |
|
# if (! $q->param("PAGER_offset") { |
199 |
|
# $q->param("Pager_offet) |
200 |
|
# } |
201 |
|
|
202 |
my $pager = HTML::Pager->new( |
my $pager = HTML::Pager->new( |
203 |
query => $q, |
query => $q, |
204 |
get_data_callback => sub { |
get_data_callback => sub { |