Changeset 13068


Ignore:
Timestamp:
2006-10-10T15:26:58+13:00 (18 years ago)
Author:
kjdon
Message:

when unbuilding and rebuilding the gdbm database for incremental building, we need to make sure the old documents are processed in the same order as they were originally added, otherwise the docnums don't match up with the index or text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify.pm

    r12844 r13068  
    238238    # dig out top level doc sections
    239239    my %top_sections = ();
     240    my %top_docnums = ();
    240241    foreach my $key ( keys %gdbm_recs )
    241242    {
     
    246247        next if ($key =~ m/\./);
    247248        $top_sections{$key} = $md_hash;
     249        $top_docnums{$key} = $md_hash->{'docnum'};
    248250    }
    249251    }
     
    251253    # for greenstone document objects based on metadata in gdbm file
    252254    my @all_docs = ();
    253     foreach my $oid ( keys %top_sections )
     255    # we need to make sure the documents were processed in the same order as
     256    # before, so sort based on their docnums
     257    foreach my $oid ( sort { $top_docnums{$a} <=> $top_docnums{$b} } keys %top_sections )
    254258    {
    255259    my $doc_db_hash = $top_sections{$oid};
     
    257261    my $doc_obj = new doc();
    258262    $doc_obj->set_OID($oid);
    259 
    260263    my $top = $doc_obj->get_top_section();
    261264        add_section_content ($doc_obj, $top, $doc_db_hash);
Note: See TracChangeset for help on using the changeset viewer.