Ignore:
Timestamp:
2012-10-16T21:12:31+13:00 (12 years ago)
Author:
ak19
Message:
  1. When purging documents from the fedora repository during import and buildcol, these documents are also removed from the Fedora GSearch index. Likewise, when documents are ingested into the Fedora repository during buildcol, these documents are also indexed by Fedora GSearch. 2. Added methods in g2futil.pm to be able to do this
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/g2f-import.pl

    r26183 r26324  
    209209    print "* Updating existing Greenstone $gs_col objects from Fedora $pid_namespace\n";
    210210        print "***\n";
     211
     212    # set up fedoragsearch for updating the index upon ingesting documents
     213    my $fedoragsearch_webapp = &g2futil::gsearch_webapp_folder();
     214   
     215    # need the username and password preset in order to run fedoraGSearch's RESTClient script
     216    # this assumes that the fedoragsearch authentication details are the same as for fedora
     217    if (defined $fedoragsearch_webapp) {   
     218        $ENV{'fgsUserName'} = $options->{'username'};
     219        $ENV{'fgsPassword'} = $options->{'password'};
     220    }
    211221
    212222    # readdir
     
    243253
    244254        if ($dsinfo_status == 0) {
     255            # first remove the doc from the gsearch index before removing it from the fedora repository
     256            print "  deleting $pid from GSearch index\n";
     257            &g2futil::run_delete_from_index($fedoragsearch_webapp,$pid,$options) if defined $fedoragsearch_webapp;
     258
    245259            print "  $pid being updated.\n";       
    246260            &g2futil::run_purge($pid,$options);
Note: See TracChangeset for help on using the changeset viewer.