/sw_index_tests

(Relevancy) tests against the Stanford SearchWorks Solr Index, using rspec-solr and rsolr gems.

Primary LanguageRubyOtherNOASSERTION

SearchWorks Solr Index Tests

<img src=“https://gemnasium.com/sul-dlss/sw_index_tests.png” alt=“Dependency Status” />

A ruby “application” for testing the Stanford University Libraries SearchWorks Solr index, using rspec-solr and rsolr gems.

The main reason this is in publicly accessible web space is to allow it to serve as an exemplar for folks who want to use rspec-solr or who want to figure out a way to automate testing searches against a Solr index.

Usage

If you wish to create a similar app for YOUR Solr index, you can fork this project or do something like the following:

Copy the following files:

  • Rakefile

  • Gemfile

  • spec/spec_helper.rb

Choose a way to pass your solr baseurl to the app

Use a command line argument:

rake passing URL=http://your_solr_baseurl

Use a config file

copy config/solr.yml from this project

If you wish to keep your solr url out of a remote git repo, you can do this:

git update-index --assume-unchanged config/solr.yml
NOTE: in spec/spec_helper.rb, line 10 or shows the default expected yml group is "test"

Write specs for YOUR Solr index!

There are lots of examples in the spec folder.

See rspec-solr Gem documentation for the full syntax. Documentation around here somewhere:

Contribute helper methods here or to rspec-solr.

Contributing

  1. Fork it

  2. Create your feature branch (‘git checkout -b my-new-feature`)

  3. Commit your changes (‘git commit -am ’Added some feature’‘)

  4. Push to the branch (‘git push origin my-new-feature`)

  5. Create new Pull Request