17 |
use YAML qw/LoadFile/; |
use YAML qw/LoadFile/; |
18 |
use Getopt::Long; |
use Getopt::Long; |
19 |
use File::Path; |
use File::Path; |
20 |
|
use Time::HiRes qw/time/; |
21 |
|
|
22 |
=head1 NAME |
=head1 NAME |
23 |
|
|
77 |
die "no databases in config file!\n" unless ($config->{databases}); |
die "no databases in config file!\n" unless ($config->{databases}); |
78 |
|
|
79 |
my $total_rows = 0; |
my $total_rows = 0; |
80 |
|
my $start_t = time(); |
81 |
|
|
82 |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
83 |
|
|
107 |
$log->info("creating new database $database in $db_path"); |
$log->info("creating new database $database in $db_path"); |
108 |
rmtree( $db_path ) || $log->warn("can't remove $db_path: $!"); |
rmtree( $db_path ) || $log->warn("can't remove $db_path: $!"); |
109 |
} else { |
} else { |
110 |
$log->info("working on $database in $db_path"); |
$log->debug("working on $database in $db_path"); |
111 |
} |
} |
112 |
|
|
113 |
my $db = new WebPAC::Store( |
my $db = new WebPAC::Store( |
144 |
|
|
145 |
my $input_module = $config->{webpac}->{inputs}->{$type}; |
my $input_module = $config->{webpac}->{inputs}->{$type}; |
146 |
|
|
147 |
$log->info("working on input $input->{path} [$input->{type}] using $input_module"); |
$log->info("working on input '$input->{path}' [$input->{type}] using $input_module lookup '$input->{lookup}'"); |
148 |
|
|
149 |
my $input_db = new WebPAC::Input( |
my $input_db = new WebPAC::Input( |
150 |
module => $input_module, |
module => $input_module, |
207 |
|
|
208 |
}; |
}; |
209 |
|
|
210 |
$log->info("$total_rows records indexed"); |
my $dt = time() - $start_t; |
211 |
|
$log->info("$total_rows records indexed in " . |
212 |
|
sprintf("%.2f sec [%.2f rec/sec]", |
213 |
|
$dt, ($total_rows / $dt) |
214 |
|
) |
215 |
|
); |
216 |
|
|
217 |
# |
# |
218 |
# add Hyper Estraier links to other databases |
# add Hyper Estraier links to other databases |