The Islandora Solr Views module adds Islandora Solr as an option when creating or editing views with the Drupal Views module. This means you can author Drupal Views that pull metadata from Solr documents, and makes it possible to construct new types of visualizations and access points for collections, and new ways of authoring Views blocks using things like contextual filters. This module is most useful to those with some experience with Drupal Views in 7.x and its features. In short, anything one could do with Drupal Views - e.g. create pages that contain the OCR output of books, or create blocks with short at-a-glance lists of new objects added to a particular collection - can be done with Islandora's Solr index.
https://github.com/Islandora/islandora_solr_views
Install as usual, see this for further information.
Islandora Solr Views is a small bit of extra functionality on Drupal Views. This Duraspace Islandora wiki doesn't cover Drupal in general, but for this specific module, it's very helpful to have worked through some tutorials about "Views" in Drupal 7, so you know the context and how Views are used to make a user interface. Views is heavily rooted in Drupal, and Islandora Solr Views brings in a bit more interaction with the Islandora objects on the site.
To enable Solr Views:
When those are enabled, the Views configuration screen should be available by clicking to "Structure" then "Views" (at http://path.to.your.site/admin/structure/views ). From here, you can click 'Add new view' to start creating a Solr View.
On the next screen, enter a name for your view, and from the 'Show' drop-down menu, select 'Islandora Solr'. This extra drop down menu option is the meat of what Islandora Solr Views is doing to build on Drupal's built-in Views.
You can now click the 'Continue & Edit' button if you'd like to manipulate the view now, or 'Save & Exit' if you would like to edit it later.
From here, most of the configuration and setup for your view is exactly the same as for any other view, with a few significant differences. Islandora Solr Views adds Solr indices to the FIELDS, FILTER CRITERIA and SORT CRITERIA sections.
This tutorial assumes a fresh installation of Islandora with the default Solr and Gsearch setups, and that the Basic Image Solution Pack has been installed and contains images. |
Create a new View
Click to "Structure" then "Views".
In the "Show" box, select "Islandora Solr".
When creating a new view, the option to "Create a Page" will be checked, and the option to "Create a Block" will be unchecked. Uncheck "Create a Page". Check the box to "Create a Block".
By default, a block will be created that contains no more than five items in an unformatted list. For this tutorial, these settings will be fine. Click 'Continue & Edit' to continue.
Configure the Block:
Under "Fields", remove the "Islandora Solr: Score" field by clicking on "Islandora Solr: Score" and then in the pop up box clicking "Remove".
In the top right corner, click "Save" to save the change.
Add the 'dc.title' field to FIELDS
Titles of objects created with an XML form are given the 'dc.title' field. This is what we are going to want our block to display.
In the "Fields" section, click the 'Add' button. On the overlay that comes up, select "Islandora Solr: dc.title" from the list. Click "Apply (all displays)".
For a small block, we probably don't want a label showing up for every object listed, so uncheck 'Create a label'.
Check the 'Link field to object' button to make sure each object is being linked to from the block.
Click 'Apply (all displays)' again to close the overlay.
Add the 'RELS_EXT_isMemberOfCollection_uri_ms' field to FILTER CRITERIA
We want our objects to be filtered from a certain collection. RELS-EXT datastreams define this collection with the format 'info:fedora/namespace:collection_pid'. In the case of a standard installation of Islandora, the Basic Image Solution Pack will have the RELS-EXT isMemberOfCollection_uri_ms field 'info:fedora/islandora:sp_basic_image_collection'. At any time, you can check a collection's namespace:collection_pid by clicking the 'Manage' tab on that collection, and then clicking the "Datastreams" button. The collection's namespace:collection_pid will be above the list of datastreams.
Next to "FILTER CRITERIA", click the "add" button. Check off "Islandora Solr: RELS_EXT_isMemberOfCOllection_uri_ms" from the list, and click "Apply (all displays)". On the next screen, under the 'RELS_EXT_isMemberOfCOllection_uri_ms' field, add 'info:fedora/islandora:sp_basic_image_collection'.
Click "Apply (all displays)" again to close the overlay.
The Islandora Solr Views module has no configuration options of its own, but pulls entries from the Solr index. Check the Islandora Solr section for more information on setting up Islandora Solr.