Show
Ignore:
Timestamp:
06.02.2009 18:19:44 (11 years ago)
Author:
davidb
Message:

Support for reindexing a document added

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/bin/script/import.pl

    r18456 r18469  
    572572    # gobal blocking pass may set up some metadata 
    573573    &plugin::file_block_read($pluginfo, $importdir, "", $block_hash, $metadata, $gli); 
    574     # Can now work out which files were new, already existed, and have 
    575     # been deleted 
    576  
    577     &inexport::new_vs_old_import_diff($archive_info,$block_hash,$importdir); 
    578      
    579     my @deleted_files = sort keys %{$block_hash->{'deleted_files'}}; 
    580     if (scalar(@deleted_files>0)) { 
    581         print STDERR "Delete files:\n  "; 
    582         print STDERR join("\n  ",@deleted_files), "\n"; 
    583     } 
    584  
    585     my @new_files = sort keys %{$block_hash->{'new_files'}}; 
    586     if (scalar(@new_files>0)) { 
    587         print STDERR "New files:\n  "; 
    588         print STDERR join("\n  ",@new_files), "\n"; 
    589     } 
    590  
    591     &inexport::mark_docs_for_deletion($archive_info,\@deleted_files,$archivedir, 
    592         $verbosity); 
     574 
     575 
     576    if (!$removeold) { 
     577        # Can now work out which files were new, already existed, and have 
     578        # been deleted 
     579         
     580        &inexport::new_vs_old_import_diff($archive_info,$block_hash,$importdir); 
     581         
     582        my @deleted_files = sort keys %{$block_hash->{'deleted_files'}}; 
     583        if (scalar(@deleted_files>0)) { 
     584        print STDERR "Files deleted since last import:\n  "; 
     585        print STDERR join("\n  ",@deleted_files), "\n"; 
     586        } 
     587         
     588        my @new_files = sort keys %{$block_hash->{'new_files'}}; 
     589        if (scalar(@new_files>0)) { 
     590        print STDERR "New files since last import:\n  "; 
     591        print STDERR join("\n  ",@new_files), "\n"; 
     592        } 
     593         
     594        &inexport::mark_docs_for_deletion($archive_info,\@deleted_files, 
     595                          $archivedir,$verbosity); 
     596 
     597        my @existing_files = sort keys %{$block_hash->{'existing_files'}}; 
     598 
     599        my @reindex_files 
     600        = &inexport::mark_docs_for_reindex($archive_info,\@existing_files, 
     601                           $archivedir,$verbosity); 
     602    } 
    593603 
    594604    &plugin::read ($pluginfo, $importdir, "", $block_hash, $metadata, $processor, $maxdocs, 0, $gli);