Changeset 1973
- Timestamp:
- 2001-02-14T16:32:45+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/mgbuilder.pm
r1803 r1973 103 103 foreach $language (@{$self->{'collect_cfg'}->{'languages'}}) { 104 104 foreach $index (@$indexes) { 105 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$language"); 105 if (defined ($self->{'collect_cfg'}->{'indexsubcollections'})) { 106 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$language"); 107 } 108 else { # add in an empty subcollection field 109 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index\:\:$language"); 110 } 106 111 } 107 112 } … … 351 356 $dirname = $self->make_unique (\%pnames, $index, \$pindex, \$psub, \$plang); 352 357 } 358 $mapping{$index} = $dirname; 353 359 354 360 # store the mapping orders as well as the maps 361 # also put index, subcollection and language fields into the mapping thing - 362 # (the full index name (eg document:text:subcol:lang) is not used on 363 # the query page) -these are used for collectionmeta later on 355 364 if (!defined $mapping{'indexmap'}{"$level:$gran"}) { 356 365 $mapping{'indexmap'}{"$level:$gran"} = $pindex; 357 366 push (@{$mapping{'indexmaporder'}}, "$level:$gran"); 367 if (!defined $mapping{"$level:$gran"}) { 368 $mapping{"$level:$gran"} = $pindex; 369 } 358 370 } 359 371 if ($psub =~ /\w/ && !defined ($mapping{'subcollectionmap'}{$subcollection})) { 360 372 $mapping{'subcollectionmap'}{$subcollection} = $psub; 361 373 push (@{$mapping{'subcollectionmaporder'}}, $subcollection); 374 $mapping{$subcollection} = $psub; 362 375 } 363 376 if ($plang =~ /\w/ && !defined ($mapping{'languagemap'}{$languages})) { 364 377 $mapping{'languagemap'}{$languages} = $plang; 365 push (@{$mapping{'languagemaporder'}}, $language );366 }367 $mapping{$index} = $dirname;378 push (@{$mapping{'languagemaporder'}}, $languages); 379 $mapping{$languages} = $plang; 380 } 368 381 $dirnames{$dirname} = $index; 369 382 $pnames{'index'}{$pindex} = "$level:$gran"; … … 471 484 # to a subcollection 472 485 my $indexexparr = []; 473 my ($level, $fields, $subcollection) = split (":", $index); 486 487 # there may be subcollection info, and language info. 488 my ($level, $fields, $subcollection, $language) = split (":", $index); 474 489 my @subcollections = (); 475 490 @subcollections = split /,/, $subcollection if (defined $subcollection); … … 482 497 483 498 # add expressions for languages if this index belongs to 484 # a language subcollection 485 foreach $language (@{$self->{'collect_cfg'}->{'languages'}}) { 499 # a language subcollection - only put languages expressions for the 500 # ones we want in the index 501 502 my @languages = (); 503 @languages = split /,/, $language if (defined $language); 504 foreach $language (@languages) { 505 my $not=0; 486 506 if ($language =~ s/^\!//) { 487 push (@$indexexparr, "!Language/$language/"); 488 } else { 489 push (@$indexexparr, "Language/$language/"); 507 $not = 1; 508 } 509 foreach $lang (@{$self->{'collect_cfg'}->{'languages'}}) { 510 if ($lang eq $language) { 511 if($not) { 512 push (@$indexexparr, "!Language/$language/"); 513 } else { 514 push (@$indexexparr, "Language/$language/"); 515 } 516 last; 517 } 490 518 } 491 519 } … … 654 682 print $handle "<$self->{'index_mapping'}->{$cmeta}>" . 655 683 $self->{'collect_cfg'}->{'collectionmeta'}->{".$cmeta"} . "\n"; 656 } else { 684 } 685 else { 657 686 print $outhandle "mgbuilder: warning bad collectionmeta option '$cmeta' - ignored\n"; 658 687 }
Note:
See TracChangeset
for help on using the changeset viewer.