How to Implement A Virtual Bookshelf With Solr

  • Naomi Dushay, Stanford University,
  • Jessie Keck, Stanford University,

Code4Lib 2010 - Wednesday, February 24 - 14:00-14:20

Browsing bookshelves has long been a useful research technique as well as an activity many users enjoy. As larger and larger portions of our physical library materials migrate to offsite storage, having a browse-able virtual shelf organized by call number is a much-desired feature. I will talk about how we implemented nearby-on-shelf in Blacklight at Stanford, using Solr and SolrMarc:

  1. the code to get shelfkeys out of call numbers
  2. the code to lop volume data off the end of call numbers to avoid clutter in the browse
  3. what I indexed in Solr given we have
    1. multiple call numbers for a single bib record
    2. multiple bib records for a single call number
  4. Solr configuration, requests and responses to get call numbers before and after a given starting point as well as the desired information for display.
  5. Other code needed to implement this feature in Blacklight (concepts easily ported to other UIs).

This virtual shelf is not only browsable across locations, but includes any item with a call number in our collection (digital or physical materials).

Naomi says: “Some of this code is available in SolrMarc trunk as of 2010-02-28, but with the upgrade to SolrMarc version 2.1, the stanfordBlacklight example will probably not be up to date for a few weeks. The Blacklight part of the code will also be forthcoming.”


Stanford’s SearchWorks Solr configuration files: