Build Status | Coverage Status | Dependency Status | Gem Version


Harvest Stanford DOR resources into a Spotlight exhibit.


Add this line to your application's Gemfile:

gem 'spotlight-dor-resources'

And then execute:

$ bundle

Or install it yourself as:

$ gem install spotlight-dor-resources


Within a Spotlight application with spotlight-dor-resources installed, you could index a set of records the "gdor-indexer" way.

Note that Spotlight:

  • is a Rails engine and needs to be used in the context of a Rails application. We use engine_cart to create an internal test application at .internal_test_app.
  • uses Solr as part of its integration tests. We use solr_wrapper to manage the Solr instance used for development and test.

Our $ rake ci task utilizes Solr and the testing rails app, with Spotlight installed, automatically.

For access to a Rails console with the gem loaded up for testing purposes, you can use an engine-cart generated Spotlight app.

First time only configuration for local testing

$ bundle
$ bundle exec rake ci

This will download a test jetty instance (to run Solr), generate a testing app at .internal_test_app and run the tests.

Indexing with the generated test app

$ solr_wrapper
$ bundle exec rake engine_cart:console
druid="ty202yt2402" # a feigenbaum druid
druid="cx709ty7769" # a revs druid druid) # need an exhibit to attach the test solr docs too

puts purl.to_solr.first # the solr document as a hash
public_xml=purl.resources[0].public_xml # nokogiri doc with all public XML
mods=purl.resources[0].mods # nokogiri doc with just the MODs
smods_rec=purl.resources[0].smods_rec # a Stanford::Mods::Record Object (which inherits from the MODS gem)

puts purl.resources[0].bare_druid # will not have the "druid:" prefix
puts purl.resources[0].druid # might have the "druid:" prefix (if returned as the result of an is_collection call)

purl.resources[0].indexer.config.solr.url # the configured solr server (should be localhost in development) # save to database and index to solr
purl.reindex # reindex once saved the first time


  1. Fork it ( )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request