Skip to content

Instantly share code, notes, and snippets.

Created July 15, 2014 17:13
What would you like to do?
# Set up a reader and a writer
# First we need to require the reader/writer we want
require 'traject'
require 'traject/marc4j_reader'
require 'traject/debug_writer'
settings do
provide "reader_class_name", "Traject::Marc4JReader"
provide "marc_source.encoding", "UTF-8"
provide "solrj_writer.commit_on_close", "true"
# Log what version of jruby/java we're using RUBY_DESCRIPTION
# index the id, title, and author
to_field "id", extract_marc("907a", :first => true)
to_field "title_display", extract_marc('245a', :first => true)
to_field 'title_vern_display', extract_marc('245abdefghknp', :alternate_script=>:only, :first=>true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment