Bug 10811 - Add a 999$c record matching rule to the MARC21 defaults
authorDavid Cook <dcook@prosentient.com.au>
Mon, 2 Sep 2013 03:25:03 +0000 (13:25 +1000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 31 Jan 2014 19:17:53 +0000 (19:17 +0000)
This patch adds a default record matching rule for biblionumber
using the 999$c and the Local-Number index.

This is part of the optional marc21 SQL, as well as in the
updatabase.pl script.

TEST PLAN
---------
 1) Apply the SQL for adding the KohaBiblio matching rule.
 2) Run updatedatabase.pl
 3) Export some MARC bibliographic records from Koha
 4) Import those same MARC bibliographic records using the
     "KohaBiblio" record matching rule.
 5) The incoming records should match perfectly
 6) Check the mysql tables (marc_matchers, matchpoints,
      matcher_matchpoints, matchpoint_components,
      matchpoint_component_norms) to make sure the values were
     inserted as expected.

Optional: install a new Koha MARC21 database from scratch and
ensure that the sample matching rules are loaded.  Add at
least one bib record, and try steps 1-6.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Dropped the database update from the original patch, as the matching
rules are not at present mandatory during installation.

installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql

index 4d39a5e..1160094 100644 (file)
@@ -36,3 +36,11 @@ INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
 INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) 
     SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components;
 
+INSERT INTO marc_matchers (code, description, record_type, threshold)
+    VALUES ('KohaBiblio', '999$c', 'biblio', 1000);
+INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'Local-Number', 1000 FROM marc_matchers;
+INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
+INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
+    SELECT MAX(matchpoint_id), 1, '999', 'c' FROM matchpoints;
+INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine)
+    SELECT MAX(matchpoint_component_id), 1, 'Biblionumber' FROM matchpoint_components;
\ No newline at end of file