Harvest Stanford DOR resources into a Spotlight exhibit.
Add this line to your application's Gemfile:
And then execute:
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.
$ 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 purl=Spotlight::Resources::DorHarvester.new(druid_list: druid) purl.exhibit=Spotlight::Exhibit.new # need an exhibit to attach the test solr docs too purl.exhibit.title='stanford' purl.exhibit.save puts purl.to_solr.first # the solr document as a hash public_xml=purl.resources.public_xml # nokogiri doc with all public XML mods=purl.resources.mods # nokogiri doc with just the MODs smods_rec=purl.resources.smods_rec # a Stanford::Mods::Record Object (which inherits from the MODS gem) puts purl.resources.bare_druid # will not have the "druid:" prefix puts purl.resources.druid # might have the "druid:" prefix (if returned as the result of an is_collection call) purl.resources.indexer.config.solr.url # the configured solr server (should be localhost in development) purl.save # save to database and index to solr purl.reindex # reindex once saved the first time
- Fork it ( http://github.com/sul-dlss/spotlight-dor-resources/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request