/[webpac2]/trunk/run.pl
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 /trunk/run.pl

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

revision 430 by dpavlin, Mon Apr 17 15:09:54 2006 UTC revision 431 by dpavlin, Mon Apr 17 15:10:04 2006 UTC
# Line 75  $config = LoadFile($config); Line 75  $config = LoadFile($config);
75  print "config = ",Dumper($config) if ($debug);  print "config = ",Dumper($config) if ($debug);
76    
77  die "no databases in config file!\n" unless ($config->{databases});  die "no databases in config file!\n" unless ($config->{databases});
78    
79    my $log = _new WebPAC::Common()->_get_logger();
80    
81  my $use_indexer = $config->{use_indexer} || 'hyperestraier';  my $use_indexer = $config->{use_indexer} || 'hyperestraier';
82    $log->info("using $use_indexer indexing engine...");
83    
84  my $total_rows = 0;  my $total_rows = 0;
85  my $start_t = time();  my $start_t = time();
# Line 84  while (my ($database, $db_config) = each Line 88  while (my ($database, $db_config) = each
88    
89          next if ($only_db_name && $database !~ m/$only_db_name/i);          next if ($only_db_name && $database !~ m/$only_db_name/i);
90    
         my $log = _new WebPAC::Common()->_get_logger();  
   
91          my $indexer;          my $indexer;
92    
93            my $indexer_config = $config->{$use_indexer} || $log->logdie("can't find '$use_indexer' part in confguration");
94            $indexer_config->{database} = $database;
95            $indexer_config->{clean} = $clean;
96            $indexer_config->{label} = $db_config->{name};
97    
98          if ($use_indexer eq 'hyperestraier') {          if ($use_indexer eq 'hyperestraier') {
99    
                 #  
100                  # open Hyper Estraier database                  # open Hyper Estraier database
                 #  
   
101                  use WebPAC::Output::Estraier '0.10';                  use WebPAC::Output::Estraier '0.10';
102                  my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration");                  $indexer = new WebPAC::Output::Estraier( %{ $indexer_config } );
103                  $est_config->{database} = $database;          
104                  $est_config->{clean} = $clean;          } elsif ($use_indexer eq 'kinosearch') {
105                  $est_config->{label} = $db_config->{name};  
106                    # open KinoSearch
107                    use WebPAC::Output::KinoSearch;
108                    $indexer = new WebPAC::Output::KinoSearch( %{ $indexer_config } );
109    
                 $indexer = new WebPAC::Output::Estraier( %{ $est_config } );  
110          } else {          } else {
111                  $log->logdie("unknown use_indexer: $use_indexer");                  $log->logdie("unknown use_indexer: $use_indexer");
112          }          }
# Line 227  while (my ($database, $db_config) = each Line 233  while (my ($database, $db_config) = each
233                  )                  )
234          );          );
235    
236          if ($use_indexer eq 'hyperestraier') {          #
237                  #          # add Hyper Estraier links to other databases
238                  # add Hyper Estraier links to other databases          #
239                  #          if (ref($db_config->{links}) eq 'ARRAY') {
240                  if (ref($db_config->{links}) eq 'ARRAY') {                  foreach my $link (@{ $db_config->{links} }) {
241                          foreach my $link (@{ $db_config->{links} }) {                          if ($use_indexer eq 'hyperestraier') {
242                                  $log->info("adding link $database -> $link->{to} [$link->{credit}]");                                  $log->info("adding link $database -> $link->{to} [$link->{credit}]");
243                                  $indexer->add_link(                                  $indexer->add_link(
244                                          from => $database,                                          from => $database,
245                                          to => $link->{to},                                          to => $link->{to},
246                                          credit => $link->{credit},                                          credit => $link->{credit},
247                                  );                                  );
248                            } else {
249                                    $log->warn("NOT IMPLEMENTED WITH $use_indexer: adding link $database -> $link->{to} [$link->{credit}]");
250                          }                          }
251                  }                  }
         } else {  
                 $log->warn("links not implemented for $use_indexer");  
252          }          }
253    
254  }  }

Legend:
Removed from v.430  
changed lines
  Added in v.431

  ViewVC Help
Powered by ViewVC 1.1.26