Changeset 4192


Ignore:
Timestamp:
2003-04-18T14:23:57+12:00 (21 years ago)
Author:
sjboddie
Message:

Added maxnumeric build time configuration option. This is useful for collections containing
numeric values longer than 4 digits which need to be searchable.

Location:
trunk/gsdl/perllib
Files:
2 edited

Legend:

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

    r2772 r4192  
    4343# {'textcompress'}->string
    4444# {'buildtype'}->string
     45# {'maxnumeric'}->string
    4546
    4647# {'maintainer'}->array of strings
     
    7273                    q/textcompress|buildtype|no_text|keepold|gzip/ .
    7374                    q/verbosity|allclassifications|OIDtype|maxdocs|/ .
    74                     q/groupsize|sortmeta|debug|mode|create_images)$/,
     75                    q/groupsize|sortmeta|debug|mode|create_images|/ .
     76                    q/maxnumeric)$/,
    7577                    q/(maintainer|languages|indexsubcollections|/ .
    7678                       q/indexes|dontbuild|dontgdbm|mirror|phind|levels)$/,
     
    8688                 q/^(creator|public|defaultindex|importdir|/ .
    8789                 q/archivedir|cachedir|builddir|removeold|/ .
    88                  q/textcompress|buildtype|collectdir|no_text|allclassifications)$/,
     90                 q/textcompress|buildtype|collectdir|no_text|/ .
     91                 q/allclassifications|maxnumeric)$/,
    8992                 q/^(maintainer|languages|indexsubcollections|/ .
    9093                 q/indexes|dontbuild|dontgdbm|levels)$/,
     
    104107# {'numwords'}->string
    105108# {'numbytes'}->string
     109# {'maxnumeric'}->string
    106110# {'indexfields'}->array of strings
    107111# {'indexfieldmap'}->array of strings in the form "field->FI"
     
    112116
    113117    return &cfgread::read_cfg_file ($filename,
    114                     q/^(builddate|buildtype|numdocs|numwords|numbytes)$/,
     118                    q/^(builddate|buildtype|numdocs|numwords|numbytes|maxnumeric)$/,
    115119                    q/^(metadata|languages|indexfields|indexfieldmap|indexmap)$/);
    116120}
     
    120124
    121125    &cfgread::write_cfg_file($filename, $data,
    122            q/^(builddate|buildtype|numdocs|numwords|numbytes)$/,
     126           q/^(builddate|buildtype|numdocs|numwords|numbytes|maxnumeric)$/,
    123127           q/^(metadata|languages|indexfieldsindexfieldmap|indexmap)$/);
    124128}
  • trunk/gsdl/perllib/mgbuilder.pm

    r3115 r4192  
    202202    my $outhandle = $self->{'outhandle'};
    203203
     204    my $maxnumeric = 4;
     205    if (defined($self->{'collect_cfg'}->{'maxnumeric'}) &&
     206    $self->{'collect_cfg'}->{'maxnumeric'} =~ /^\d+$/) {
     207    $maxnumeric = $self->{'collect_cfg'}->{'maxnumeric'};
     208    }
     209
    204210    &util::mk_all_dir (&util::filename_cat($self->{'build_dir'}, "text"));
    205211    my $basefilename = "text/$self->{'collection'}";
     
    224230    } else {
    225231    if (!-e "$mg_passes_exe" ||
    226         !open (PIPEOUT, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T1 $osextra")) {
     232        !open (PIPEOUT, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T1 -M $maxnumeric $osextra")) {
    227233        die "mgbuilder::compress_text - couldn't run $mg_passes_exe\n";
    228234    }
     
    264270    # -b $maxdocsize sets the maximum document size to be 12 meg
    265271    if (!-e "$mg_passes_exe" ||
    266         !open ($handle, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T2 $osextra")) {
     272        !open ($handle, "| mg_passes$exe -f \"$fulltextprefix\" -b $maxdocsize -T2 -M $maxnumeric $osextra")) {
    267273        die "mgbuilder::compress_text - couldn't run $mg_passes_exe\n";
    268274    }
     
    475481    &util::filename_cat ($exedir, "mg_stem_idx$exe");
    476482
     483    my $maxnumeric = 4;
     484    if (defined($self->{'collect_cfg'}->{'maxnumeric'}) &&
     485    $self->{'collect_cfg'}->{'maxnumeric'} =~ /^\d+$/) {
     486    $maxnumeric = $self->{'collect_cfg'}->{'maxnumeric'};
     487    }
     488
    477489    my $osextra = "";
    478490    if ($ENV{'GSDLOS'} =~ /^windows$/i) {
     
    538550    if (!-e "$mg_passes_exe" ||
    539551        !open (PIPEOUT, "| mg_passes$exe -f \"$fullindexprefix\" -b $maxdocsize " .
    540            "-$index_level -m 32 -s 0 -G -t 10 -N1 $osextra")) {
     552           "-$index_level -m 32 -s 0 -G -t 10 -N1 -M $maxnumeric $osextra")) {
    541553        die "mgbuilder::build_index - couldn't run $mg_passes_exe\n";
    542554    }
     
    567579    if (!-e "$mg_passes_exe" ||
    568580        !open ($handle, "| mg_passes$exe -f \"$fullindexprefix\" -b $maxdocsize " .
    569            "-$index_level -c 3 -G -t 10 -N2 $osextra")) {
     581           "-$index_level -c 3 -G -t 10 -N2 -M $maxnumeric $osextra")) {
    570582        die "mgbuilder::build_index - couldn't run $mg_passes_exe\n";
    571583    }
     
    822834    $build_cfg->{'notbuilt'} = $self->{'notbuilt'} if scalar @{$self->{'notbuilt'}};
    823835
     836    $build_cfg->{'maxnumeric'} = 4;
     837    if (defined($self->{'collect_cfg'}->{'maxnumeric'}) &&
     838    $self->{'collect_cfg'}->{'maxnumeric'} =~ /^\d+$/) {
     839    $build_cfg->{'maxnumeric'} = $self->{'collect_cfg'}->{'maxnumeric'};
     840    }
     841
    824842    # write out the build information
    825843    &cfgread::write_cfg_file("$self->{'build_dir'}/build.cfg", $build_cfg,
    826                  '^(builddate|numdocs|numbytes|numwords|numsections)$',
     844                 '^(builddate|numdocs|numbytes|numwords|numsections|maxnumeric)$',
    827845                             '^(indexmap|subcollectionmap|languagemap|notbuilt)$');
    828846
Note: See TracChangeset for help on using the changeset viewer.