--- trunk/run.pl 2006/08/01 16:47:40 608 +++ trunk/run.pl 2006/09/05 15:14:14 627 @@ -8,7 +8,7 @@ use WebPAC::Common 0.02; use WebPAC::Lookup 0.03; -use WebPAC::Input 0.07; +use WebPAC::Input 0.11; use WebPAC::Store 0.03; use WebPAC::Normalize 0.11; use WebPAC::Output::TT; @@ -117,6 +117,16 @@ my $only_links = 0; my $merge = 0; +my $log = _new WebPAC::Common()->_get_logger(); + +my $hostname = `hostname`; +chomp($hostname); +$hostname =~ s/\..+$//; +if (-e "conf/$hostname.yml") { + $config = "conf/$hostname.yml"; + $log->info("using host configuration file: $config"); +} + GetOptions( "limit=i" => \$limit, "offset=i" => \$offset, @@ -138,11 +148,10 @@ $config = LoadFile($config); -print "config = ",dump($config) if ($debug); +#print "config = ",dump($config) if ($debug); die "no databases in config file!\n" unless ($config->{databases}); -my $log = _new WebPAC::Common()->_get_logger(); $log->info( "-" x 79 ); @@ -199,7 +208,11 @@ my $indexer; if ($use_indexer) { - my $indexer_config = $config->{$use_indexer} || $log->logdie("can't find '$use_indexer' part in confguration"); + + my $cfg_name = $use_indexer; + $cfg_name =~ s/\-.*$//; + + my $indexer_config = $config->{$cfg_name} || $log->logdie("can't find '$cfg_name' part in confguration"); $indexer_config->{database} = $database; $indexer_config->{clean} = $clean; $indexer_config->{label} = $db_config->{name}; @@ -213,6 +226,14 @@ use WebPAC::Output::Estraier '0.10'; $indexer = new WebPAC::Output::Estraier( %{ $indexer_config } ); + } elsif ($use_indexer eq 'hyperestraier-native') { + + # open Hyper Estraier database + use WebPAC::Output::EstraierNative; + $indexer = new WebPAC::Output::EstraierNative( %{ $indexer_config } ); + + $use_indexer = 'hyperestraier'; + } elsif ($use_indexer eq 'kinosearch') { # open KinoSearch