Changeset 27818


Ignore:
Timestamp:
07/11/13 16:21:04 (8 years ago)
Author:
kjdon
Message:

adding in stuff for facets

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/buildConfigxml.pm

    r27803 r27818  
    391391    $settings->{'sortmap'} = $sortmap;
    392392
    393     ### TODO make these use facets not the sort list
    394     $settings->{'facetlist'} = $sortlist;
    395     $settings->{'facetmap'} = $sortmap;
     393    # facet field list
     394    ######
     395
     396    my $facetmap = {};  # maps index name to shortname
     397    my $facetlist = []; # keeps the order for indexes
     398
     399    if (defined ($buildcfg->{"indexfacetfieldmap"})) {
     400    my $facetmap_t = $buildcfg->{"indexfacetfieldmap"};
     401    foreach my $s (@$facetmap_t) {
     402        my ($k, $v) = $s =~ /^(.*)\-\>(.*)$/;
     403        $facetmap->{$v} = $k;
     404    }
     405    }
     406    if (defined ($buildcfg->{"indexfacetfields"})) {
     407    $facetlist = $buildcfg->{"indexfacetfields"};
     408    }
     409
     410    $settings->{'facetlist'} = $facetlist;
     411    $settings->{'facetmap'} = $facetmap;
    396412
    397413
     
    503519    foreach my $ff (@$facetlist) {
    504520        my $facetf = $facetmap->{$ff};
    505         &write_line('COLCFG', ["<facet name=\"", $ff, "\" shortname=\"", $facetf, "\" />"]);
     521        &write_line('COLCFG', ["<facet name=\"", $facetf, "\" shortname=\"", $ff, "\" />"]);
    506522    }
    507523    &write_line('COLCFG', ["</facetList>"]);
Note: See TracChangeset for help on using the changeset viewer.