Closed dbrower closed 9 years ago
Some code is here: https://github.com/banurekha/blacklight-hierarchy
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.
Adding hierarchy gem to catalog_controller :
Looking at current solrconfig.xml
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]
}
}
Ah apologies! you specify this at the top of the issue!
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 !
Implemented and tested locally with sample subset of hierarchy facets with 166658aeedd689d1c0224486c2e0e1f1497fcf10
They should still be like what are currently in the DL. There are three such facets:
dc_subject_h_facet
)dwc_scientificname_h_facet
...i think)dct_spatial_h_facet
)They consist of list of terms, using colons to separate the hierarchy. E.g. Kenya has the solr field: