--- trunk/run.pl 2006/04/17 15:09:54 430 +++ trunk/run.pl 2006/04/17 15:10:04 431 @@ -75,7 +75,11 @@ print "config = ",Dumper($config) if ($debug); die "no databases in config file!\n" unless ($config->{databases}); + +my $log = _new WebPAC::Common()->_get_logger(); + my $use_indexer = $config->{use_indexer} || 'hyperestraier'; +$log->info("using $use_indexer indexing engine..."); my $total_rows = 0; my $start_t = time(); @@ -84,23 +88,25 @@ next if ($only_db_name && $database !~ m/$only_db_name/i); - my $log = _new WebPAC::Common()->_get_logger(); - my $indexer; + my $indexer_config = $config->{$use_indexer} || $log->logdie("can't find '$use_indexer' part in confguration"); + $indexer_config->{database} = $database; + $indexer_config->{clean} = $clean; + $indexer_config->{label} = $db_config->{name}; + if ($use_indexer eq 'hyperestraier') { - # # open Hyper Estraier database - # - use WebPAC::Output::Estraier '0.10'; - my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration"); - $est_config->{database} = $database; - $est_config->{clean} = $clean; - $est_config->{label} = $db_config->{name}; + $indexer = new WebPAC::Output::Estraier( %{ $indexer_config } ); + + } elsif ($use_indexer eq 'kinosearch') { + + # open KinoSearch + use WebPAC::Output::KinoSearch; + $indexer = new WebPAC::Output::KinoSearch( %{ $indexer_config } ); - $indexer = new WebPAC::Output::Estraier( %{ $est_config } ); } else { $log->logdie("unknown use_indexer: $use_indexer"); } @@ -227,22 +233,22 @@ ) ); - if ($use_indexer eq 'hyperestraier') { - # - # add Hyper Estraier links to other databases - # - if (ref($db_config->{links}) eq 'ARRAY') { - foreach my $link (@{ $db_config->{links} }) { + # + # add Hyper Estraier links to other databases + # + if (ref($db_config->{links}) eq 'ARRAY') { + foreach my $link (@{ $db_config->{links} }) { + if ($use_indexer eq 'hyperestraier') { $log->info("adding link $database -> $link->{to} [$link->{credit}]"); $indexer->add_link( from => $database, to => $link->{to}, credit => $link->{credit}, ); + } else { + $log->warn("NOT IMPLEMENTED WITH $use_indexer: adding link $database -> $link->{to} [$link->{credit}]"); } } - } else { - $log->warn("links not implemented for $use_indexer"); } }