--- trunk/run.pl 2005/12/20 00:03:04 307 +++ trunk/run.pl 2006/01/22 13:38:17 389 @@ -17,6 +17,7 @@ use YAML qw/LoadFile/; use Getopt::Long; use File::Path; +use Time::HiRes qw/time/; =head1 NAME @@ -40,6 +41,10 @@ remove database and Hyper Estraier index before indexing +=item --one=database_name + +reindex just single database + =item --config conf/config.yml path to YAML configuration file @@ -54,11 +59,13 @@ my $clean = 0; my $config = 'conf/config.yml'; my $debug = 0; +my $one_db_name; GetOptions( "limit=i" => \$limit, "offset=i" => \$offset, "clean" => \$clean, + "one=s" => \$one_db_name, "config" => \$config, "debug" => \$debug, ); @@ -70,9 +77,12 @@ die "no databases in config file!\n" unless ($config->{databases}); my $total_rows = 0; +my $start_t = time(); while (my ($database, $db_config) = each %{ $config->{databases} }) { + next if ($one_db_name && $database !~ m/$one_db_name/i); + my $log = _new WebPAC::Common()->_get_logger(); # @@ -197,7 +207,12 @@ }; - $log->info("$total_rows records indexed"); + my $dt = time() - $start_t; + $log->info("$total_rows records indexed in " . + sprintf("%.2f sec [%.2f rec/sec]", + $dt, ($total_rows / $dt) + ) + ); # # add Hyper Estraier links to other databases