Created
May 9, 2014 13:05
-
-
Save bemosior/2568f9b93b4961e6014f to your computer and use it in GitHub Desktop.
MultiBackend Import Process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Properties for the Java import program | |
# $Id: vufind_config.properties $ | |
# solrmarc.solr.war.path - must point to either a war file for the version of Solr that | |
# you want to use, or to a directory of jar files extracted from a Solr war files. If | |
# this is not provided, SolrMarc can only work by communicating with a running Solr server. | |
# IMPORTANT NOTE FOR WINDOWS USERS: | |
# Use forward slashes, not back slashes (i.e. c:/vufind/..., not c:\vufind\...) | |
solrmarc.solr.war.path=/usr/local/vufind/solr/jetty/webapps/solr.war | |
# solrmarc.custom.jar.path - Jar containing custom java code to use in indexing. | |
# If solr.indexer below is defined (other than the default of org.solrmarc.index.SolrIndexer) | |
# you MUST define this value to be the Jar containing the class listed there. | |
solrmarc.custom.jar.path=VuFindIndexer.jar | |
# Path to your solr instance | |
solr.path = /usr/local/vufind/solr | |
solr.core.name = biblio | |
solr.indexer = org.solrmarc.index.VuFindIndexer | |
solr.indexer.properties = marc.properties, your_local.properties | |
#optional URL of running solr search engine to cause updates to be recognized. | |
solr.hosturl = http://your.solr.server:8080/solr/biblio/update | |
#where to look for properties files, translation maps, and custom scripts | |
#note that . refers to the directory where the jarfile for SolrMarc is located. | |
solrmarc.path = /usr/local/vufind/import | |
# Path to your marc file | |
marc.to_utf_8 = true | |
marc.permissive = true | |
marc.default_encoding = BESTGUESS | |
marc.include_errors = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.marc4j.marc.Record; | |
// define the base level indexer so that its methods can be called from the script. | |
// note that the SolrIndexer code will set this value before the script methods are called. | |
org.solrmarc.index.SolrIndexer indexer = null; | |
/** | |
* Produce an ID which can uniquely identify KLN libraries by prefixing it with their ID | |
* @param record | |
* @param prefixstr A string to prefix the ID with, | |
* such as the 3-letter library ID with an underscore ("shp_") | |
* @return The prefixed ID | |
*/ | |
public String getPrefixedId(Record record, String prefixstr) { | |
return prefixstr + indexer.getFirstFieldVal(record, "001"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id = script(your_indexer.bsh), getPrefixedId("yourprefix.") | |
institution = "Your Library" | |
building = "Your Building" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment