Ignore:
Timestamp:
2009-02-06T18:19:44+13:00 (15 years ago)
Author:
davidb
Message:

Support for reindexing a document added

File:
1 edited

Legend:

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

    r18456 r18469  
    251251    }
    252252
    253     $self->delete_info ($OID);
     253    if (defined $self->{'info'}->{$OID}) {
     254    # test to see if we are in a reindex situation
     255
     256    my $existing_status_info = $self->get_status_info($OID);
     257
     258    if ($existing_status_info eq "D") {
     259        # yes, we're in a reindexing situation
     260        $self->delete_info ($OID);
     261
     262
     263        # force setting to "reindex"
     264        $index_status = "R";
     265
     266    }
     267    else {
     268        # some other, possibly erroneous, situation has arisen
     269        # where the document already seems to exist
     270        print STDERR "Warning: $OID already exists with index status $existing_status_info\n";
     271        print STDERR "         Deleting previous version\n";
     272
     273        $self->delete_info ($OID);
     274    }
     275    }
     276
    254277    $self->{'info'}->{$OID} = [$doc_file,$index_status];
    255278    push (@{$self->{'order'}}, [$OID, $sortmeta]);
     279
     280
    256281}
    257282
Note: See TracChangeset for help on using the changeset viewer.