/[webpac]/branches/tehnika/WebPac.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /branches/tehnika/WebPac.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 637 by dpavlin, Tue Jan 18 17:17:06 2005 UTC revision 652 by dpavlin, Thu Jan 27 21:17:47 2005 UTC
# Line 12  use Text::Unaccent; Line 12  use Text::Unaccent;
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    
# Line 270  sub show_results_list { Line 270  sub show_results_list {
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
# Line 361  sub show_results_list { Line 361  sub show_results_list {
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;
# Line 369  sub show_results_list { Line 369  sub show_results_list {
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    
# Line 438  sub show_index { Line 438  sub show_index {
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(
# Line 447  sub show_index { Line 449  sub show_index {
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;
# Line 482  sub show_index { Line 484  sub show_index {
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);

Legend:
Removed from v.637  
changed lines
  Added in v.652

  ViewVC Help
Powered by ViewVC 1.1.26