Changeset 21644

Show
Ignore:
Timestamp:
26.01.2010 17:23:28 (9 years ago)
Author:
mdewsnip
Message:

Changed IncrementalBuildUtils::setDocumentMetadata() to take the infodbtype type as a parameter, instead of assuming GDBM. Part of making the code less GDBM-specific.

Location:
main/trunk/greenstone2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/set_metadata.pl

    r12844 r21644  
    3838if ($action eq "ADD") 
    3939{ 
    40   &IncrementalBuildUtils::setDocumentMetadata($collection, $oid, $field, "", $a_value, 1); 
     40  &IncrementalBuildUtils::setDocumentMetadata($collection, "gdbm", $oid, $field, "", $a_value, 1); 
    4141} 
    4242elsif ($action eq "REMOVE") 
    4343{ 
    44   &IncrementalBuildUtils::setDocumentMetadata($collection, $oid, $field, $a_value, "", 1); 
     44  &IncrementalBuildUtils::setDocumentMetadata($collection, "gdbm", $oid, $field, $a_value, "", 1); 
    4545} 
    4646elsif ($action eq "REPLACE") 
    4747{ 
    48   &IncrementalBuildUtils::setDocumentMetadata($collection, $oid, $field, $a_value, $b_value, 1); 
     48  &IncrementalBuildUtils::setDocumentMetadata($collection, "gdbm", $oid, $field, $a_value, $b_value, 1); 
    4949} 
    5050 
  • main/trunk/greenstone2/perllib/IncrementalBuildUtils.pm

    r21643 r21644  
    9090        if ($key eq "docnum") 
    9191          { 
    92             &setDocumentMetadata($collection, $doc_obj->get_OID() . "$section", $key, "", $value, $updateindex); 
     92            &setDocumentMetadata($collection, $infodbtype, $doc_obj->get_OID() . "$section", $key, "", $value, $updateindex); 
    9393            $found_docnum = 1; 
    9494          } 
     
    119119              } 
    120120            # Go ahead and set the metadata 
    121             &setDocumentMetadata($collection, $doc_obj->get_OID() . "$section", $key, "", $value, $updateindex); 
     121            &setDocumentMetadata($collection, $infodbtype, $doc_obj->get_OID() . "$section", $key, "", $value, $updateindex); 
    122122          } 
    123123      } 
     
    195195sub setDocumentMetadata() 
    196196  { 
    197     my ($collection, $oid, $key, $old_value, $new_value, $updateindex) = @_; 
    198     print STDERR "IncrementalBuildUtils::setDocumentMetadata('$collection','$oid','$key','$old_value','$new_value',$updateindex)\n" unless !$debug; 
     197    my ($collection, $infodbtype, $oid, $key, $old_value, $new_value, $updateindex) = @_; 
     198    print STDERR "IncrementalBuildUtils::setDocumentMetadata('$collection',$infodbtype,'$oid','$key','$old_value','$new_value',$updateindex)\n" unless !$debug; 
    199199    # A. Establish connection to Lucene 
    200200    #    This isn't required at the moment, but might be later if we implement