/[webpac2]/trunk/run.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/run.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 301 by dpavlin, Mon Dec 19 21:26:04 2005 UTC revision 335 by dpavlin, Sat Dec 31 14:00:36 2005 UTC
# Line 13  use WebPAC::Input 0.03; Line 13  use WebPAC::Input 0.03;
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.05;  use WebPAC::Output::Estraier 0.08;
17  use YAML qw/LoadFile/;  use YAML qw/LoadFile/;
18  use Getopt::Long;  use Getopt::Long;
19  use File::Path;  use File::Path;
# Line 40  limit loading to 100 records Line 40  limit loading to 100 records
40    
41  remove database and Hyper Estraier index before indexing  remove database and Hyper Estraier index before indexing
42    
43    =item --one=database_name
44    
45    reindex just single database
46    
47  =item --config conf/config.yml  =item --config conf/config.yml
48    
49  path to YAML configuration file  path to YAML configuration file
# Line 54  my $limit; Line 58  my $limit;
58  my $clean = 0;  my $clean = 0;
59  my $config = 'conf/config.yml';  my $config = 'conf/config.yml';
60  my $debug = 0;  my $debug = 0;
61    my $one_db_name;
62    
63  GetOptions(  GetOptions(
64          "limit=i" => \$limit,          "limit=i" => \$limit,
65          "offset=i" => \$offset,          "offset=i" => \$offset,
66          "clean" => \$clean,          "clean" => \$clean,
67            "one=s" => \$one_db_name,
68          "config" => \$config,          "config" => \$config,
69          "debug" => \$debug,          "debug" => \$debug,
70  );  );
# Line 73  my $total_rows = 0; Line 79  my $total_rows = 0;
79    
80  while (my ($database, $db_config) = each %{ $config->{databases} }) {  while (my ($database, $db_config) = each %{ $config->{databases} }) {
81    
82            next if ($one_db_name && $database !~ m/$one_db_name/i);
83    
84          my $log = _new WebPAC::Common()->_get_logger();          my $log = _new WebPAC::Common()->_get_logger();
85    
86          #          #
# Line 81  while (my ($database, $db_config) = each Line 89  while (my ($database, $db_config) = each
89    
90          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");
91          $est_config->{database} = $database;          $est_config->{database} = $database;
92            $est_config->{clean} = $clean;
93    
94          my $est = new WebPAC::Output::Estraier(          my $est = new WebPAC::Output::Estraier( %{ $est_config } );
                 %{ $est_config },  
         );  
   
         if ($clean) {  
                 $log->warn("creating new empty index $database");  
                 $est->master( action => 'nodedel', name => $database );  
                 $est->master( action => 'nodeadd', name => $database, label => $database );  
         }  
95    
96          #          #
97          # now WebPAC::Store          # now WebPAC::Store

Legend:
Removed from v.301  
changed lines
  Added in v.335

  ViewVC Help
Powered by ViewVC 1.1.26