About Features Downloads Getting Started Documentation Events Support GitHub

Love VuFind®? Consider becoming a financial supporter. Your support helps build a better VuFind®!

Site Tools


Warning: This page has not been updated in over over a year and may be outdated or deprecated.
indexing:marc:multiple_configs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
indexing:marc:multiple_configs [2020/10/12 20:37] – [Understanding SolrMarc Configuration Files] demiankatzindexing:marc:multiple_configs [2020/10/12 20:58] (current) demiankatz
Line 3: Line 3:
 There are often situations where you need to apply different configuration settings to different MARC files. For example, if you load files from different libraries, you may wish to use different hard-coded "collection," "institution" and/or "building" facets for each file. Fortunately, the [[indexing:solrmarc|SolrMarc]] import tool makes this fairly easy to accomplish. There are often situations where you need to apply different configuration settings to different MARC files. For example, if you load files from different libraries, you may wish to use different hard-coded "collection," "institution" and/or "building" facets for each file. Fortunately, the [[indexing:solrmarc|SolrMarc]] import tool makes this fairly easy to accomplish.
  
-===== Understanding SolrMarc Configuration Files =====+===== SolrMarc Configuration Files =====
  
 It is important to understand that SolrMarc has two different kinds of configuration files: It is important to understand that SolrMarc has two different kinds of configuration files:
Line 14: Line 14:
 The index specification file(s) contain the rules for performing the indexing operation. The index specification file(s) contain the rules for performing the indexing operation.
  
 +===== The -p Switch =====
  
 +The ./import-marc.sh script which VuFind provides as a convenient wrapper around SolrMarc includes a -p switch, which can be used to specify the full path of a SolrMarc configuration file to load. When the switch is omitted, the script will use $VUFIND_LOCAL_DIR/import/import.properties if it exists and $VUFIND_HOME/import/import.properties otherwise.
 +
 +===== Configuring Index Specification Files =====
 +
 +SolrMarc loads index specification files based on the "solr.indexer.properties" setting in its configuration file. In VuFind, the default value for this setting is "marc.properties, marc_local.properties" -- this means that marc.properties defines the default settings, but entries in marc_local.properties will take precedence and override the equivalent settings from marc.properties.
 +
 +You can include any number of comma-separated filenames here, and they will all be chained together, with later files overriding settings from earlier files.
 +
 +The solrmarc.path setting lists the directories where SolrMarc will search for the specified filenames; when VuFind's default configuration is being used, it will first look in $VUFIND_LOCAL_DIR/import, and then in $VUFIND_HOME/import.
 +
 +===== Example: Putting It All Together =====
 +
 +Suppose you have two files: library1.mrc and library2.mrc. When you index library1.mrc, you want to set the Institution facet to "Library 1," and when you index library2.mrc, you want to set the Institution facet to "Library 2." You can meet this goal by following these steps:
 +
 +==== Step 1: Create the Indexing Specification Files ====
 +
 +You'll need to create an indexing specification file for each institution, like this:
 +
 +$VUFIND_LOCAL_DIR/import/marc_library1.properties:
 +<code>
 +institution = "Library 1"
 +</code>
 +
 +$VUFIND_LOCAL_DIR/import/marc_library2.properties:
 +<code>
 +institution = "Library 2"
 +</code>
 +
 +==== Step 2: Create SolrMarc Configuration Files Pointing to the Index Specification Files ====
 +
 +You need a separate SolrMarc configuration for each library that is set up to load the appropriate index specification file. You can create two copies of $VUFIND_LOCAL_DIR/import/import.properties, and edit each one to customize the solr.indexer.properties setting appropriately.
 +
 +$VUFIND_LOCAL_DIR/import/import_library1.properties:
 +<code>
 +...
 +solr.indexer.properties = marc.properties, marc_local.properties, marc_library1.properties
 +...
 +</code>
 +
 +$VUFIND_LOCAL_DIR/import/import_library2.properties:
 +<code>
 +...
 +solr.indexer.properties = marc.properties, marc_local.properties, marc_library2.properties
 +...
 +</code>
 +
 +==== Step 3: Run the Indexing Process ====
 +
 +Now you simply need to use the -p switch to specify the correct configuration for each MARC file:
 +
 +<code bash>
 +cd $VUFIND_HOME
 +./import-marc.sh -p $VUFIND_LOCAL_DIR/import/import_library1.properties library1.mrc
 +./import-marc.sh -p $VUFIND_LOCAL_DIR/import/import_library2.properties library2.mrc
 +</code>
 ---- struct data ---- ---- struct data ----
 +properties.Page Owner : 
 ---- ----
  
indexing/marc/multiple_configs.1602535077.txt.gz · Last modified: 2020/10/12 20:37 by demiankatz