vecnet / dl-discovery

Map based discovery interface for digital library records
Other
4 stars 3 forks source link

Support the hierarchal facets #40

Closed dbrower closed 9 years ago

dbrower commented 9 years ago

They should still be like what are currently in the DL. There are three such facets:

They consist of list of terms, using colons to separate the hierarchy. E.g. Kenya has the solr field:

[
"Africa",
"Africa:Republic of Kenya"
]
dbrower commented 9 years ago

Some code is here: https://github.com/banurekha/blacklight-hierarchy

stevenvandervalk commented 9 years ago

Updated gem is now https://github.com/sul-dlss/blacklight-hierarchy. Three custom partials might be required. e.g. https://github.com/vecnet/vecnet-dl/blob/master/app/views/catalog/location_facet.html.erb

The backend data structure (string:substring:subsubstring) seems to be similar but @dbrower is checking out why not currently in solr, whether the authorities methods(where geonames_hierachical_faceting has been moved to ) are correctly creating it.

stevenvandervalk commented 9 years ago

Adding hierarchy gem to catalog_controller :

Looking at current solrconfig.xml

https://github.com/vecnet/deploy-dl/blob/b03fadad80212cbe060ea927e725b9ac468635fc/roles/solr/files/solrconfig.xml#L138

I'm guessing the full Solr field name facets with _h suffix ( with slightly different names )

<str name="facet.field">dc_subject_h_facet</str>
<str name="facet.field">dwc_scientificname_h_facet</str>

should be used instead of the facet_fields used in the old vecnet-dl code?https://github.com/vecnet/vecnet-dl/blob/66fa300b206f93941ca473e56602673c7362254f/app/controllers/catalog_controller.rb#L127

below

config.add_facet_field 'hierarchy_facet', :label => 'Subject', :partial => 'blacklight/hierarchy/facet_hierarchy', :limit => 100000, :show=> false, :sort => 'index'
    config.add_facet_field 'location_hierarchy_facet', :label => 'Location', :partial => 'blacklight/hierarchy/facet_hierarchy', :limit => 100000, :show=> false, :sort => 'index'
    config.add_facet_field 'species_hierarchy_facet', :label => 'Species', :partial => 'blacklight/hierarchy/facet_hierarchy', :limit => 100000, :show=> false, :sort => 'index'
    config.facet_display = {
        :hierarchy => {
            'hierarchy' => [nil],
            'location_hierarchy' => [nil],
            'species_hierarchy' => [nil]
        }
    }
stevenvandervalk commented 9 years ago

Ah apologies! you specify this at the top of the issue!

stevenvandervalk commented 9 years ago

Added the controller code into a branch 1949f4a0300bdb29cf89f5d80376f85cdb54a6c2 It needs to be wired up to the UI once some hierarchal data is available as json to ingest into my local vagrant and test. Thanks for doing that @dbrower !

stevenvandervalk commented 9 years ago

Implemented and tested locally with sample subset of hierarchy facets with 166658aeedd689d1c0224486c2e0e1f1497fcf10