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:solrmarc

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
indexing:solrmarc [2017/01/23 21:24] – [Dynamically-Compiled Java Code] demiankatzindexing:solrmarc [2018/03/05 14:50] – [VuFind 4.0 and newer] demiankatz
Line 34: Line 34:
 ===== Customizing Format Determination ===== ===== Customizing Format Determination =====
  
-One of the most commonly-requested VuFind customizations involves changing the way record formats are assigned.+One of the most commonly-requested VuFind customizations involves changing the way record formats are assigned. The method for this depends on your VuFind version.
  
-By default, formats are generated using the getFormat function built into SolrMarc.  However, the logic used by getFormat is also replicated in a BeanShell script packaged with VuFind.  If you want to customize the behavior, here are the steps to follow:+==== VuFind 4.0 and newer ==== 
 + 
 +More recent versions of VuFind determine formats using a getFormat function found in [[https://github.com/vufind-org/vufind/blob/master/import/index_java/src/org/vufind/index/FormatCalculator.java|FormatCalculator.java]]. You can override this file in your [[configuration:local_settings_directory|local settings directory]] to adjust the behavior. 
 + 
 +==== VuFind 3.x and earlier ==== 
 + 
 +By default, formats are generated in older versions of VuFind using the getFormat function built into SolrMarc.  However, the logic used by getFormat is also replicated in a BeanShell script packaged with VuFind.  If you want to customize the behavior, here are the steps to follow: 
 + 
 +  - Copy import/index_java/src/org/vufind/index/FormatCalculator.java into the import/index_java/src/edu/myuniversity/index (replacing edu/myuniversity with an appropriate domain for your institution) subdirectory of your [[configuration:local_settings_directory|local settings directory]] and edit it to customize the behavior as needed.  Be sure to adjust the package declaration at the top of the file to match the directory path you created, so you can differentiate your local indexing class from the core one. The MARC access is accomplished with the [[http://marc4j.tigris.org/|MARC4J]] library. 
 +  - If your new custom script returns different values than the old script, or if you want to change the way the existing values are mapped into your index, edit a local copy of the translation map found in import/translation_maps/format_map.properties. 
 +  - If SolrMarc has difficulty finding your custom code, you can edit a local copy of import/marc_local.properties to ensure that VuFind loads the appropriate class. This could look like: 
 + 
 +  format = custom(edu.myuniversity.index.FormatCalculator), getFormat, format_map.properties 
 + 
 +==== VuFind 3.x and earlier ==== 
 + 
 +By default, formats are generated in older versions of VuFind using the getFormat function built into SolrMarc.  However, the logic used by getFormat is also replicated in a BeanShell script packaged with VuFind.  If you want to customize the behavior, here are the steps to follow:
  
   - Copy import/index_scripts/format.bsh into the import/index_scripts subdirectory of your [[configuration:local_settings_directory|local settings directory]] and edit it to customize the behavior as needed.  BeanShell borrows its syntax and libraries from Java, so the code should look familiar to many developers.  The MARC access is accomplished with the [[http://marc4j.tigris.org/|MARC4J]] library.   - Copy import/index_scripts/format.bsh into the import/index_scripts subdirectory of your [[configuration:local_settings_directory|local settings directory]] and edit it to customize the behavior as needed.  BeanShell borrows its syntax and libraries from Java, so the code should look familiar to many developers.  The MARC access is accomplished with the [[http://marc4j.tigris.org/|MARC4J]] library.
indexing/solrmarc.txt · Last modified: 2024/02/23 11:34 by demiankatz