13 |
use WebPAC::Store 0.03; |
use WebPAC::Store 0.03; |
14 |
use WebPAC::Normalize::XML; |
use WebPAC::Normalize::XML; |
15 |
use WebPAC::Output::TT; |
use WebPAC::Output::TT; |
16 |
use WebPAC::Output::Estraier 0.08; |
use WebPAC::Output::Estraier '0.10'; |
17 |
use YAML qw/LoadFile/; |
use YAML qw/LoadFile/; |
18 |
use Getopt::Long; |
use Getopt::Long; |
19 |
use File::Path; |
use File::Path; |
41 |
|
|
42 |
remove database and Hyper Estraier index before indexing |
remove database and Hyper Estraier index before indexing |
43 |
|
|
44 |
=item --one=database_name |
=item --only=database_name |
45 |
|
|
46 |
reindex just single database |
reindex just single database (legacy name is --one) |
47 |
|
|
48 |
=item --config conf/config.yml |
=item --config conf/config.yml |
49 |
|
|
59 |
my $clean = 0; |
my $clean = 0; |
60 |
my $config = 'conf/config.yml'; |
my $config = 'conf/config.yml'; |
61 |
my $debug = 0; |
my $debug = 0; |
62 |
my $one_db_name; |
my $only_db_name; |
63 |
|
|
64 |
GetOptions( |
GetOptions( |
65 |
"limit=i" => \$limit, |
"limit=i" => \$limit, |
66 |
"offset=i" => \$offset, |
"offset=i" => \$offset, |
67 |
"clean" => \$clean, |
"clean" => \$clean, |
68 |
"one=s" => \$one_db_name, |
"one=s" => \$only_db_name, |
69 |
|
"only=s" => \$only_db_name, |
70 |
"config" => \$config, |
"config" => \$config, |
71 |
"debug" => \$debug, |
"debug" => \$debug, |
72 |
); |
); |
82 |
|
|
83 |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
84 |
|
|
85 |
next if ($one_db_name && $database !~ m/$one_db_name/i); |
next if ($only_db_name && $database !~ m/$only_db_name/i); |
86 |
|
|
87 |
my $log = _new WebPAC::Common()->_get_logger(); |
my $log = _new WebPAC::Common()->_get_logger(); |
88 |
|
|
93 |
my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration"); |
my $est_config = $config->{hyperestraier} || $log->logdie("can't find 'hyperestraier' part in confguration"); |
94 |
$est_config->{database} = $database; |
$est_config->{database} = $database; |
95 |
$est_config->{clean} = $clean; |
$est_config->{clean} = $clean; |
96 |
|
$est_config->{label} = $db_config->{name}; |
97 |
|
|
98 |
my $est = new WebPAC::Output::Estraier( %{ $est_config } ); |
my $est = new WebPAC::Output::Estraier( %{ $est_config } ); |
99 |
|
|
154 |
limit => $limit || $input->{limit}, |
limit => $limit || $input->{limit}, |
155 |
offset => $offset, |
offset => $offset, |
156 |
lookup => $lookup, |
lookup => $lookup, |
157 |
|
recode => $input->{recode}, |
158 |
); |
); |
159 |
$log->logdie("can't create input using $input_module") unless ($input); |
$log->logdie("can't create input using $input_module") unless ($input); |
160 |
|
|