X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=bin%2FBackupPC_updatedb;h=a0d00690e6c3c7e9ded45a3527a0ad455d0b80ec;hb=2630cbae3c9db4d44a7fd754f8a1deaefde0dc5e;hp=2290a197ed37b56776ced70bdfe279011990a6ea;hpb=c895c85bd282936cd38d900904bd94734fdc8248;p=BackupPC.git diff --git a/bin/BackupPC_updatedb b/bin/BackupPC_updatedb index 2290a19..a0d0069 100755 --- a/bin/BackupPC_updatedb +++ b/bin/BackupPC_updatedb @@ -15,18 +15,6 @@ use BackupPC::Search; use Cwd qw/abs_path/; use Data::Dump qw(dump); -our $search_module; -BEGIN { - $search_module = "BackupPC::Search::Estraier"; - $search_module = "BackupPC::Search::KinoSearch" if $ENV{KINO}; - eval "use $search_module"; - if ( $@ ) { - warn "ERROR: $search_module: $!"; - } else { - warn "# using $search_module for full-text search"; - } -} - use constant BPC_FTYPE_DIR => 5; use constant EST_CHUNK => 4096; @@ -131,7 +119,7 @@ sub hest_update { my $offset = 0; my $added = 0; - my $search = $search_module->new( $index_node_url ); + my $search = BackupPC::Search->search_module; my $results = 0; @@ -202,6 +190,8 @@ sub hest_update { } while ($results == EST_CHUNK); + $search->commit; + my $dur = (time() - $t) || 1; printf(" [%.2f/s dur: %s]\n", ( $added / $dur ),