Changeset 5768


Ignore:
Timestamp:
2003-10-30T11:48:52+13:00 (20 years ago)
Author:
kjdon
Message:

added a check for failed indexing - just test to see if the .id file exists. if not, don't continue with building that index. Indexes that haven't been built are no longer included in the indexmap entry in teh build config file - and therefore wont appear in the list of indexes

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r5225 r5768  
    8080              'no_text'=>$no_text,
    8181              'failhandle'=>$failhandle,
    82               'notbuilt'=>[]    # indexes not built
     82              'notbuilt'=>{}    # indexes not built
    8383              }, $class;
    8484
     
    305305    foreach $checkstr (@{$self->{'collect_cfg'}->{'dontbuild'}}) {
    306306        if ($index =~ /^$checkstr$/) {
    307         push (@{$self->{'notbuilt'}}, $self->{'index_mapping'}->{$index});
     307        #push (@{$self->{'notbuilt'}}, $self->{'index_mapping'}->{$index});
     308        $self->{'notbuilt'}->{$index} = 1;
    308309        return 0;
    309310        }
     
    583584    $self->print_stats();
    584585
     586    # now we check to see if the required files have been produced - if not we quit building this index so the whole process doesn't crap out.
     587    # we check on the .id file - index dictionary
     588    my $dict_file = "$fullindexprefix.id";
     589    if (!-e $dict_file) {
     590    print $outhandle "mgbuilder::build_index - Couldn't create index $index\n";
     591    $self->{'notbuilt'}->{$index}=1;
     592    return;
     593    }
    585594    if (!$self->{'debug'}) {
    586595    # create the perfect hash function
     
    825834
    826835    # store the mapping between the index names and the directory names
     836    # the index map is used to determine what indexes there are, so any that are not built should not be put into the map.
    827837    my @indexmap = ();
    828838    foreach $index (@{$self->{'index_mapping'}->{'indexmaporder'}}) {
    829     push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
     839    if (not defined ($self->{'notbuilt'}->{$index})) {
     840        push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
     841    }
    830842    }
    831843    $build_cfg->{'indexmap'} = \@indexmap;
     
    845857    $build_cfg->{'languagemap'} = \@languagemap if scalar (@languagemap);
    846858
    847     $build_cfg->{'notbuilt'} = $self->{'notbuilt'} if scalar @{$self->{'notbuilt'}};
    848 
     859    #$build_cfg->{'notbuilt'} = $self->{'notbuilt'} if scalar @{$self->{'notbuilt'}};
     860    my @notbuilt = ();
     861    foreach $nb (keys %{$self->{'notbuilt'}}) {
     862    push (@notbuilt, $nb);
     863    }
     864    $build_cfg->{'notbuilt'} = \@notbuilt if scalar (@notbuilt);
    849865    $build_cfg->{'maxnumeric'} = 4;
    850866    if (defined($self->{'collect_cfg'}->{'maxnumeric'}) &&
  • trunk/gsdl/perllib/mgppbuilder.pm

    r5643 r5768  
    126126              'outhandle'=>$outhandle,
    127127              'no_text'=>$no_text,
    128               'notbuilt'=>[],    # indexes not built
     128              'notbuilt'=>{},    # indexes not built
    129129              'indexfieldmap'=>\%static_indexfield_map
    130130          }, $class;
     
    396396    foreach $checkstr (@{$self->{'collect_cfg'}->{'dontbuild'}}) {
    397397        if ($index =~ /^$checkstr$/) {
    398         push (@{$self->{'notbuilt'}}, $self->{'index_mapping'}->{$index});
     398        #push (@{$self->{'notbuilt'}}, $self->{'index_mapping'}->{$index});
     399        $self->{'notbuilt'}->{$index} = 1;
    399400        return 0;
    400401        }
     
    680681
    681682    $self->print_stats();
     683
     684    # now we check to see if the required files have been produced - if not we quit building this index so the whole process doesn't crap out.
     685    # we check on the .id file - index dictionary
     686    my $dict_file = "$fullindexprefix.id";
     687    if (!-e $dict_file) {
     688    print $outhandle "mgppbuilder::build_index - Couldn't create index $index\n";
     689    $self->{'notbuilt'}->{$index}=1;
     690    return;
     691    }
    682692
    683693    if (!$self->{'debug'}) {
     
    10591069    my @indexmap = ();
    10601070    foreach $index (@{$self->{'index_mapping'}->{'indexmaporder'}}) {
    1061     push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
     1071    if (not defined ($self->{'notbuilt'}->{$index})) {
     1072        push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
     1073    }
    10621074    }
    10631075    $build_cfg->{'indexmap'} = \@indexmap;
     
    10771089    $build_cfg->{'languagemap'} = \@languagemap if scalar (@languagemap);
    10781090
    1079     $build_cfg->{'notbuilt'} = $self->{'notbuilt'};
     1091    #$build_cfg->{'notbuilt'} = $self->{'notbuilt'};
     1092    my @notbuilt = ();
     1093    foreach $nb (keys %{$self->{'notbuilt'}}) {
     1094    push (@notbuilt, $nb);
     1095    }
     1096    $build_cfg->{'notbuilt'} = \@notbuilt if scalar (@notbuilt);
    10801097
    10811098    # write out the build information
Note: See TracChangeset for help on using the changeset viewer.