Changeset 19500

Show
Ignore:
Timestamp:
18.05.2009 11:03:08 (10 years ago)
Author:
davidb
Message:

Code now tracks if a document needs to be re-processed on an incremental build when it's metadata has changed.

Files:
1 modified

Legend:

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

    r19303 r19500  
    608608        } 
    609609         
    610         &inexport::mark_docs_for_deletion($archive_info,\@deleted_files, 
     610        &inexport::mark_docs_for_deletion($archive_info,$block_hash,\@deleted_files, 
    611611                          $archivedir,$verbosity); 
    612612 
    613         my @existing_files = sort keys %{$block_hash->{'existing_files'}}; 
    614  
    615         my @reindex_files 
    616         = &inexport::mark_docs_for_reindex($archive_info,\@existing_files, 
    617                            $archivedir,$verbosity); 
    618     } 
    619  
    620     &plugin::read ($pluginfo, $importdir, "", $block_hash, $metadata, $processor, $maxdocs, 0, $gli); 
     613        &inexport::mark_docs_for_reindex($archive_info,$block_hash, 
     614                         $archivedir,$verbosity); 
     615 
     616        my @reindex_files = sort keys %{$block_hash->{'reindex_files'}}; 
     617 
     618        if (scalar(@reindex_files>0)) { 
     619        print STDERR "Files to reindex since last import:\n  "; 
     620        print STDERR join("\n  ",@reindex_files), "\n"; 
     621        } 
     622 
     623 
     624        # not sure if the following will work -- wil the metadata datastructure be correctly initialized 
     625        # in the right order? 
     626#       foreach my $file (@new_files, @reindex_files) { 
     627#       &plugin::read ($pluginfo, $importdir, $file, $block_hash, $metadata, $processor, $maxdocs, 0, $gli); 
     628#       } 
     629 
     630 
     631        # Play it safe, and run through the entire folder, only processing new or edited files 
     632        &plugin::read ($pluginfo, $importdir, "", $block_hash, $metadata, $processor, $maxdocs, 0, $gli); 
     633 
     634    } 
     635    else { 
     636        &plugin::read ($pluginfo, $importdir, "", $block_hash, $metadata, $processor, $maxdocs, 0, $gli); 
     637    } 
     638 
    621639    } 
    622640    else 
     
    629647    my @deleted_files = keys %{$manifest_lookup->{'delete'}}; 
    630648 
    631     &inexport::mark_docs_for_deletion($archive_info,\@deleted_files,$archivedir); 
     649    &inexport::mark_docs_for_deletion($archive_info,{},\@deleted_files,$archivedir); 
    632650    } 
    633651