About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
indexing:hierarchies_and_collections

This is an old revision of the document!


Hierarchies and Collections

The features described on this page are available starting with VuFind 1.4.

Hierarchies

Some document collections are structured hierarchically. VuFind offers a mechanism for displaying these hierarchies as a pop-up within search results and as a tab of the record page.

Solr Setup

To display hierarchies, VuFind needs to be able to find information about document relationships in your Solr index. At index time, you need to populate the following fields in order to use hierarchy functionality:

  • hierarchytype - The type of hierarchy being used (this triggers loading of a hierarchy driver; it is usually easiest to leave it blank, causing VuFind to default to the driver specified in the [Hierarchy] section of config.ini).
  • hierarchy_top_id - The Solr ID of the record representing the top of the hierarchy containing the current record.
    • This may be multi-valued if a record belongs to multiple collections.
  • hierarchy_top_title - The title of the record representing the top of the hierarchy containing the current record.
    • This may be multi-valued if a record belongs to multiple collections; the order of multiple values in this field must correspond with values in hierarchy_top_id.
  • hierarchy_parent_id - The Solr ID of the record immediately above the current record in the hierarchy.
    • This may be multi-valued in the case of multiple collection membership.
  • hierarchy_parent_title - The title of the record immediately above the current record in the hierarchy.
    • This may be multi-valued if a record belongs to multiple collections; the order of multiple values in this field must correspond with values in hierarchy_parent_id.
  • hierarchy_sequence - A value indicating the position of the current record relative to its siblings, used for sorting records when rendering trees.
    • This may be multi-valued if a record belongs to multiple collections; the order of multiple values in this field must correspond with values in hierarchy_parent_id.
    • Note that this is a string field, so sorting is done alphabetically rather than numerically – numeric values may need to be padded with zeroes to achieve appropriate sorting.
  • is_hierarchy_id - If the current record represents a node within a hierarchy, this field should contain the same value as the regular id field.
  • is_hierarchy_title - If the current record represents a node within a hierarchy, this field should contain the same value as the regular title field.

VuFind Configuration

Once the Solr index is populated appropriately, you need to adjust several VuFind configuration files to make hierarchies visible.

  • In config.ini, make sure that the [Hierarchy] section contains a driver setting (Default is usually the best option if you want to show trees) and the showTree setting is true.
  • In your hierarchy driver configuration file (usually HierarchyDefault.ini in the same directory as config.ini), make sure that appropriate values are set.
  • If you are using Solr to construct tree data, you may also want to set up util/createHierarchyTrees.php as a cron job or as part of your index process to ensure that your tree cache is always filled. This will prevent users from experiencing long waits while trees are constructed on demand. If using this approach, be sure your HierarchyDefault.ini has an appropriate solrCacheTime value set (probably -1, for no expiration, if you set things up so that the cache is always populated with appropriate data).

Collections

Coming soon.

indexing/hierarchies_and_collections.1352908825.txt.gz · Last modified: 2014/06/13 13:12 (external edit)