--- trunk/run.pl 2006/05/14 13:42:48 493 +++ trunk/run.pl 2006/05/15 13:15:01 507 @@ -55,6 +55,10 @@ force conversion Cpath> in C from C<.xml> to C<.pl> +=item --stats + +dump statistics about used fields and subfields in each input + =back =cut @@ -67,6 +71,7 @@ my $debug = 0; my $only_db_name; my $force_set = 0; +my $stats = 0; GetOptions( "limit=i" => \$limit, @@ -77,6 +82,7 @@ "config" => \$config, "debug" => \$debug, "force-set" => \$force_set, + "stats" => \$stats, ); $config = LoadFile($config); @@ -104,9 +110,6 @@ $indexer_config->{clean} = $clean; $indexer_config->{label} = $db_config->{name}; - # important: clean database just once! - $clean = 0; - if ($use_indexer eq 'hyperestraier') { # open Hyper Estraier database @@ -184,6 +187,7 @@ offset => $offset, lookup => $lookup, recode => $input->{recode}, + stats => $stats, ); $log->logdie("can't create input using $input_module") unless ($input); @@ -258,6 +262,8 @@ $total_rows++; } + $log->info("statistics of fields usage:\n", $input_db->stats) if ($stats); + }; eval { $indexer->finish } if ($indexer->can('finish'));