Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
indexing:solrmarc [2018/03/05 14:50] – [VuFind 4.0 and newer] demiankatz | indexing:solrmarc [2019/05/16 18:43] – [VuFind 4.0 and newer] demiankatz |
---|
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. | 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. |
| |
==== VuFind 4.0 and newer ==== | ==== VuFind 6.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 6.0 replaces the getFormat method with getFormats (to return multiple values when appropriate). The advice below for VuFind 4.0 and newer remains relevant; just be sure to override the appropriate method. |
| |
==== VuFind 3.x and earlier ==== | ==== VuFind 4.0 and newer ==== |
| |
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: | 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. |
| |
- 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. | - 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. |