Changeset 27803 for main/trunk
- Timestamp:
- 2013-07-11T11:44:20+12:00 (11 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/buildConfigxml.pm
r26094 r27803 371 371 $settings->{'default_db_level'} = $default_db_level; 372 372 373 373 # sort field list 374 ###### 375 376 my $sortmap = {}; # maps index name to shortname 377 my $sortlist = []; # keeps the order for indexes 378 379 if (defined ($buildcfg->{"indexsortfieldmap"})) { 380 my $sortmap_t = $buildcfg->{"indexsortfieldmap"}; 381 foreach my $s (@$sortmap_t) { 382 my ($k, $v) = $s =~ /^(.*)\-\>(.*)$/; 383 $sortmap->{$v} = $k; 384 } 385 } 386 if (defined ($buildcfg->{"indexsortfields"})) { 387 $sortlist = $buildcfg->{"indexsortfields"}; 388 } 389 390 $settings->{'sortlist'} = $sortlist; 391 $settings->{'sortmap'} = $sortmap; 392 393 ### TODO make these use facets not the sort list 394 $settings->{'facetlist'} = $sortlist; 395 $settings->{'facetmap'} = $sortmap; 396 397 374 398 return $settings; 375 399 } … … 458 482 if ($buildtype eq "lucene" || $buildtype eq "mgpp" || $buildtype eq "solr") { 459 483 &write_line('COLCFG', ["<defaultDBLevel shortname=\"", $default_db_level, "\" />"]); 484 } 485 486 # do sort list 487 if ($buildtype eq "lucene" || $buildtype eq "solr") { 488 my $sortlist = $settings->{'sortlist'}; 489 my $sortmap = $settings->{'sortmap'}; 490 &write_line('COLCFG', ["<sortList>"]); 491 foreach my $sf (@$sortlist) { 492 my $sortf = $sortmap->{$sf}; 493 &write_line('COLCFG', ["<sort name=\"", $sortf, "\" shortname=\"", $sf, "\" />"]); 494 } 495 &write_line('COLCFG', ["</sortList>"]); 496 } 497 498 # do facet list 499 if ($buildtype eq "solr") { 500 &write_line('COLCFG', ["<facetList>"]); 501 my $facetlist = $settings->{'facetlist'}; 502 my $facetmap = $settings->{'facetmap'}; 503 foreach my $ff (@$facetlist) { 504 my $facetf = $facetmap->{$ff}; 505 &write_line('COLCFG', ["<facet name=\"", $ff, "\" shortname=\"", $facetf, "\" />"]); 506 } 507 &write_line('COLCFG', ["</facetList>"]); 460 508 } 461 509 # do searchTypeList -
main/trunk/greenstone2/perllib/collConfigxml.pm
r27192 r27803 51 51 "defaultIndexLanguage" => "defaultlanguage", 52 52 "index" => "indexes", 53 "sort" => "sortfields", 54 "facet" => "facetfields", 53 55 "plugin" => "plugin", 54 56 "plugout" => "plugout", … … 81 83 # ("plugin", "option") 82 84 my $currentIndex = 0; 83 my $arrayexp = q/^(index| level|indexOption|indexSubcollection|indexLanguage|orthogonalBuildTypes)$/;85 my $arrayexp = q/^(index|sort|facet|level|indexOption|indexSubcollection|indexLanguage|orthogonalBuildTypes)$/; 84 86 my $arrayarrayexp = q/^(plugin|classifier)$/; #|buildOption)$/; 85 87 my $hashexp = q/^(subcollection)$/; # add other element names that should be represented by hash expressions here … … 196 198 #} 197 199 198 #@ Handle index| level|indexOption|indexSubcollection|indexLanguage200 #@ Handle index|sort|facet|level|indexOption|indexSubcollection|indexLanguage 199 201 elsif ($element =~ /$arrayexp/) { 200 202 my $key = $nameMap->{$element};
Note:
See TracChangeset
for help on using the changeset viewer.