Warning: This page has not been updated in over over a year and may be outdated or deprecated.
indexing:koha
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
indexing:koha [2021/03/24 14:27] – [Importing Into VuFind] emaijala | indexing:koha [2023/08/28 12:25] – [The Koha ILS Driver] emaijala | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== How to index Koha with VuFind ====== | ====== How to index Koha with VuFind ====== | ||
- | This is how one university in Africa set up VuFind | + | These are general instructions for setting |
- | Koha uses an [[https:// | + | Koha uses an [[https:// |
- | ===== Exporting Records From Koha ===== | + | VuFind also supports fetching records from Koha using [[indexing: |
- | Koha has a misc/export_records.pl file which allows you to export to MARC format. | + | |
- | To run that manually, you will need to either set the path for PERL5LIB (or whatever your perl lib variable is) and the variable that points to the Koha configuration file manually, or run `koha-shell < | + | ===== VuFind Indexing Configuration ===== |
- | < | + | |
- | export PERL5LIB=/ | + | |
- | export KOHA_CONF=/ | + | |
- | </ | + | |
- | To do the export, you will want to do something like this (the paths may differ) | + | |
- | < | + | |
- | / | + | |
- | </ | + | |
- | ===== Importing Into VuFind | + | Start by configuring indexing settings in VuFind. The default settings contain everything needed for a basic setup apart from location-related fields. |
- | Once you have exported | + | |
+ | There are several ways to index location-related fields. The first one is to put library and location to separate fields, but also a single hierarchical facet can be specified as shown further below. | ||
+ | |||
+ | Using the export command described below, Koha will include MARC field 952 for each item (see [[https:// | ||
+ | These fields can be mapped to VuFind' | ||
- | Copy your marc_local.properties from $VUFIND_HOME/ | + | Copy your marc_local.properties from $VUFIND_HOME/ |
- | Make the changes you need to this file. Example settings: | + | Example settings: |
< | < | ||
institution = 952b | institution = 952b | ||
Line 30: | Line 25: | ||
id = 999c, first | id = 999c, first | ||
</ | </ | ||
- | The id = 999c is needed for Vufind to find Koha's biblionumbers properly. | ||
- | 952 field contains item information from Koha (see [[https:// | + | The id = 999c is needed for Vufind to find Koha' |
+ | |||
+ | You can also set any of the index fields to static strings if desired, for example: | ||
< | < | ||
institution = "City Library" | institution = "City Library" | ||
</ | </ | ||
- | Now you are ready to run the import: | + | ==== Hierarchical Location Facet ==== |
+ | |||
+ | You can combine library and location into a [[configuration: | ||
< | < | ||
- | ./import-marc.sh [directory]/kohabibs.marc | + | building = 952b, (pattern_map.building_0), |
+ | building += 952bc, join("/"), (pattern_map.building_1), | ||
+ | pattern_map.building_0.pattern_0 = (.+)=>0/$1/ | ||
+ | pattern_map.building_1.pattern_0 = (.+)=> | ||
</ | </ | ||
+ | |||
+ | You'll need to tell VuFind to handle the building field as a hierarchical one in $VUFIND_LOCAL_DIR/ | ||
+ | |||
+ | < | ||
+ | [SpecialFacets] | ||
+ | hierarchical[] = building | ||
+ | |||
+ | [Advanced_Settings] | ||
+ | translated_facets[] = building: | ||
+ | </ | ||
+ | |||
+ | Hierarchical facet values can be translated just like normal facet values, but you need to add translations for the different hierarchy levels. E.g. for library CPL's location FIC, you would add the following translations to $VUFIND_LOCAL_DIR/ | ||
+ | |||
+ | < | ||
+ | 0/CPL/ = " | ||
+ | 1/CPL/FIC/ = " | ||
+ | </ | ||
+ | |||
==== Suppressed Records ==== | ==== Suppressed Records ==== | ||
- | Note: If you want to exclude suppressed records from display in VuFind, you may need to add additional settings to your import configuration. Koha stores suppressed status in MARC field 942, subfield n. A value of " | + | If you want to exclude suppressed records from display in VuFind, you may need to add additional settings to your import configuration. Koha stores suppressed status in MARC field 942, subfield n. A value of " |
< | < | ||
suppressed_str = 942n ? ($n matches " | suppressed_str = 942n ? ($n matches " | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Exporting Records From Koha ===== | ||
+ | |||
+ | Koha has a misc/ | ||
+ | |||
+ | To run the export script, you will need to enter a Koha shell for the instance (< | ||
+ | < | ||
+ | koha-shell < | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | < | ||
+ | export PERL5LIB=/ | ||
+ | export KOHA_CONF=/ | ||
+ | </ | ||
+ | |||
+ | To do the export, you will want to do something like this (the paths may differ): | ||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Importing Into VuFind ===== | ||
+ | |||
+ | Once you have exported the koha records, you will need to import the records into VuFind. | ||
+ | |||
+ | If necessary, transfer the file over so that VuFind can find it. | ||
+ | |||
+ | Now you are ready to run the import: | ||
+ | < | ||
+ | ./ | ||
+ | </ | ||
+ | |||
===== The Koha ILS Driver ===== | ===== The Koha ILS Driver ===== | ||
- | :!: // The example here describes the simple, database-driven Koha driver; newer VuFind releases may include KohaILSDI and/or KohaRest drivers that implement additional functionality using APIs found in newer Koha versions. // | + | :!: // The example here describes the simple, database-driven Koha driver; newer VuFind releases may include KohaILSDI and/or KohaRest drivers that implement additional functionality using APIs found in newer Koha versions. The **KohaRest driver is recommended** as it supports the widest range of functionality and does not require direct database connection. See KohaRest.ini configuration file for more information. // |
You will need to change the $VUFIND_LOCAL_DIR/ | You will need to change the $VUFIND_LOCAL_DIR/ | ||
Line 86: | Line 140: | ||
It will prompt you for the password. | It will prompt you for the password. | ||
- | Once you have your koha.ini file set up, [[administration: | + | Once you have your koha.ini file set up, check to see that your Koha records show up, and that the holdings information shows up. |
===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
- | For Koha exporting troubleshooting, | + | For Koha exporting troubleshooting, |
For MARC import/ | For MARC import/ | ||
Line 95: | Line 150: | ||
There is a page for [[https:// | There is a page for [[https:// | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
indexing/koha.txt · Last modified: 2023/11/28 19:22 by demiankatz