42 |
|
|
43 |
remove database and Hyper Estraier index before indexing |
remove database and Hyper Estraier index before indexing |
44 |
|
|
45 |
=item --only=database_name |
=item --only=database_name/input_filter |
46 |
|
|
47 |
reindex just single database (legacy name is --one) |
reindex just single database (legacy name is --one) |
48 |
|
|
49 |
|
C</input_filter> is optional part which can be C<name> |
50 |
|
or C<type> from input |
51 |
|
|
52 |
=item --config conf/config.yml |
=item --config conf/config.yml |
53 |
|
|
54 |
path to YAML configuration file |
path to YAML configuration file |
73 |
my $clean = 0; |
my $clean = 0; |
74 |
my $config = 'conf/config.yml'; |
my $config = 'conf/config.yml'; |
75 |
my $debug = 0; |
my $debug = 0; |
76 |
my $only_db_name; |
my $only_filter; |
77 |
my $force_set = 0; |
my $force_set = 0; |
78 |
my $stats = 0; |
my $stats = 0; |
79 |
|
|
81 |
"limit=i" => \$limit, |
"limit=i" => \$limit, |
82 |
"offset=i" => \$offset, |
"offset=i" => \$offset, |
83 |
"clean" => \$clean, |
"clean" => \$clean, |
84 |
"one=s" => \$only_db_name, |
"one=s" => \$only_filter, |
85 |
"only=s" => \$only_db_name, |
"only=s" => \$only_filter, |
86 |
"config" => \$config, |
"config" => \$config, |
87 |
"debug" => \$debug, |
"debug" => \$debug, |
88 |
"force-set" => \$force_set, |
"force-set" => \$force_set, |
111 |
|
|
112 |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
while (my ($database, $db_config) = each %{ $config->{databases} }) { |
113 |
|
|
114 |
next if ($only_db_name && $database !~ m/$only_db_name/i); |
my ($only_database,$only_input) = split(m#/#, $only_filter); |
115 |
|
next if ($only_database && $database !~ m/$only_database/i); |
116 |
|
|
117 |
my $indexer; |
my $indexer; |
118 |
|
|
182 |
|
|
183 |
foreach my $input (@inputs) { |
foreach my $input (@inputs) { |
184 |
|
|
185 |
|
next if ($only_input && $input->{name} =~ m#$only_input#i || $input->{type} =~ m#$only_input#i); |
186 |
|
|
187 |
my $type = lc($input->{type}); |
my $type = lc($input->{type}); |
188 |
|
|
189 |
die "I know only how to handle input types ", join(",", @supported_inputs), " not '$type'!\n" unless (grep(/$type/, @supported_inputs)); |
die "I know only how to handle input types ", join(",", @supported_inputs), " not '$type'!\n" unless (grep(/$type/, @supported_inputs)); |