Skip to content
/ blah Public

Blacklight@Hull - Library Search and Discovery interface

Notifications You must be signed in to change notification settings

uohull/blah

Repository files navigation

Blah – Blacklight at Hull

Blah is the University of Hull’s instance of the blacklight search and discovery interface. For more information about Blacklight…

Blacklight Project site: http://projectblacklight.org/
Blacklight github: https://github.com/projectblacklight/blacklight:

Requirements/recommendations

ruby-2.1.2 (recommended)
java 1.5 or higher (in order to run solr under a jetty)
RVM (recommended for development)

In addition, you should have Bundler and Rails ruby gems installed:

gem install bundler
gem install rails

Yaz Setup

Blah uses Zoom, a Ruby z.3950 library that requires Yaz.

Yaz needs to be installed on the system before running bundle install. It
requires the standard package and the development package. Without installing
these packages first, bundle install will fail.

sudo yum install yaz libyaz4-dev

Installation guide

git clone git@github.com:uohull/blah.git

Change the current directory to “blah”

The project includes .ruby-version and .ruby-gemset files which will define a Ruby version and gemset that should be used for the project. In this case ruby-2.1.2 and gemset ‘blah’ is specified.

To install the required gems, execute:

bundle install

To create the necessary blacklight database tables, run the database migrations:

rake db:migrate

Running…

To run you must first ensure that the local Solr server is running, by navigating blah/jetty directory and..

java -jar start.jar &

Start the rails application:

rails server

Index MARC records

For Blacklight at Hull we utilise the popular MARC to Solr utility SolrMarc. Hull has taken the source distribution of SolrMarc and added some custom indexing routines to deal with local MARC choices, along with a customised index_properties file. Hull’s SolrMarc instance “blah-solrmarc” can be found at https://github.com/uohull/blah-solrmarc .

To ease the deployment of Blah in a development environment. The distribution jars, and configurations from the blah-solrmarc project have been added to this project. In order to utilise the customised solrmarc configuration; the index MARC records rake task can be run as (from the root of the blah directory):

rake solr:marc:index MARC_FILE=MARC_RECORDS_FILE CONFIG_PATH=config/SolrMarc/config.properties SOLRMARC_JAR_PATH=config/SolrMarc/SolrMarc.jar

Note: It is recommended that any changes to the Indexing configurations are done via the blah-solrmarc project and then copied to this project to keep in sync.

Index electronic resources

Electronic resources are indexed into solr from a locally produced csv file. A sample file is located in test/fixtures/e-resource.csv (this is used in the examples below). The following rake tasks exist.

To index electronic resources…

rake blah:electronic_resources:index_data  CSV_FILE_PATH=./test/fixtures/e-resources.csv

To Delete electronic resources from the index…

rake blah:electronic_resources:delete_data

To delete, and then re-index a csv…

rake blah:electronic_resources:delete_and_index_data  CSV_FILE_PATH=./test/fixtures/e-resources.csv

Configurations

The Blah project has a number of configurations for things like contact form email addresses, z39 connections pooling, syndetics client code, available record types etc… These can be found the config/blah_config.yml file. Note: there are options for configuring for the environment, ie. development, test, production.

Setting the RAILS_ENV variable will utilise the Solr instance attached to the rails env (defined in config/solr.yml) i.e.

# This will delete existing electronic resources and then index the electronic resources data into the production instance of solr specified in solr.yml
RAILS_ENV=production rake blah:electronic_resources:delete_and_index_data CSV_FILE_PATH=./test/fixtures/e-resources.csv