12 |
use Data::Pageset; |
use Data::Pageset; |
13 |
|
|
14 |
use lib '..'; |
use lib '..'; |
15 |
use index_DBI_cache; |
use index_DBI_filter; |
16 |
use back2html; |
use back2html; |
17 |
|
|
18 |
|
|
148 |
|
|
149 |
|
|
150 |
foreach my $p (@{$pager->pages_in_set()}) { |
foreach my $p (@{$pager->pages_in_set()}) { |
151 |
next if ($p < 0); |
next if ($p <= 0); |
152 |
if($p == $pager->current_page()) { |
if($p == $pager->current_page()) { |
153 |
$pager_jump .= "<b>$p</b> "; |
$pager_jump .= "<b>$p</b> "; |
154 |
} else { |
} else { |
270 |
|
|
271 |
if ($q->param("e$i")) { |
if ($q->param("e$i")) { |
272 |
push @url_params,"e$i=".$q->url_param("e$i"); |
push @url_params,"e$i=".$q->url_param("e$i"); |
273 |
push @url_params_persist,"e$i=".$q->url_param("e$i"); |
# push @url_params_persist,"e$i=".$q->url_param("e$i"); |
274 |
} |
} |
275 |
|
|
276 |
my $wc="*"; # swish wildcard |
my $wc="*"; # swish wildcard |
361 |
|
|
362 |
# create new swish instance |
# create new swish instance |
363 |
my $swish = SWISH::API->new($INDEX); |
my $swish = SWISH::API->new($INDEX); |
364 |
$swish->AbortLastError if $swish->Error; |
die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; |
365 |
|
|
366 |
# execute query and get number of results from SWISH-E |
# execute query and get number of results from SWISH-E |
367 |
my $search = $swish->New_Search_Object; |
my $search = $swish->New_Search_Object; |
369 |
$search->SetSort($sort); |
$search->SetSort($sort); |
370 |
|
|
371 |
my $results = $search->Execute($sw_q); |
my $results = $search->Execute($sw_q); |
372 |
$swish->AbortLastError if $swish->Error; |
die $swish->ErrorString.": ".$swish->LastErrorMsg if $swish->Error; |
373 |
|
|
374 |
my $hits = $results->Hits; |
my $hits = $results->Hits; |
375 |
|
|
438 |
my $field = $q->param("f$i"); |
my $field = $q->param("f$i"); |
439 |
my $limit = $q->param("v$i"); |
my $limit = $q->param("v$i"); |
440 |
|
|
441 |
|
my $filter = $q->param("filter"); |
442 |
|
|
443 |
my $html; |
my $html; |
444 |
|
|
445 |
my $index = new index_DBI( |
my $index = new index_DBI( |
449 |
$cfg_global->val('global', 'dbi_passwd') || '' |
$cfg_global->val('global', 'dbi_passwd') || '' |
450 |
); |
); |
451 |
|
|
452 |
my $total = $index->count($field,$limit); |
my $total = $index->count($field,$limit,$filter); |
453 |
|
|
454 |
if (! $total) { |
if (! defined($total)) { |
455 |
my $tmpl = $self->load_tmpl(url_ex($q,'no_index.html')); |
my $tmpl = $self->load_tmpl(url_ex($q,'no_index.html')); |
456 |
$tmpl->param('field',$field); |
$tmpl->param('field',$field); |
457 |
$html = $tmpl->output; |
$html = $tmpl->output; |
484 |
make_pager($q, $tmpl, $pager); |
make_pager($q, $tmpl, $pager); |
485 |
make_pager_vars($q, $tmpl, @persist_vars); |
make_pager_vars($q, $tmpl, @persist_vars); |
486 |
|
|
487 |
my @pager_data_list = $index->fetch($field,$limit, $pager->first - 1, $pager->entries_on_this_page); |
my @pager_data_list = $index->fetch($field,$limit, $pager->first - 1, $pager->entries_on_this_page, $filter); |
488 |
$tmpl->param('PAGER_DATA_LIST', \@pager_data_list); |
$tmpl->param('PAGER_DATA_LIST', \@pager_data_list); |
489 |
|
|
490 |
return in_template($q,$tmpl->output); |
return in_template($q,$tmpl->output); |