teach the 1.6-2.0 reingest generator about "tnf"-tag rows for title sorting
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Mar 2011 17:19:26 +0000 (17:19 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 15 Mar 2011 17:19:26 +0000 (17:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_0@19755 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/sql/Pg/reingest-1.6-2.0.pl

index 988a7b0..483cc92 100755 (executable)
@@ -77,6 +77,21 @@ sub fetch_num_bibs_from_database {
 
 sub header {
     print OUT q {
+\qecho First, make sure that the rows needed for title sorting are
+\qecho available.
+
+BEGIN; 
+DELETE FROM metabib.real_full_rec WHERE tag = 'tnf'; 
+INSERT INTO metabib.real_full_rec (record, tag, subfield, value) 
+   SELECT  record, 
+           'tnf', 
+           'a', 
+           SUBSTRING(value, COALESCE(NULLIF(REGEXP_REPLACE(ind2,'[^0-9]','','g'),''),'0')::int + 1) 
+     FROM  metabib.real_full_rec 
+     WHERE tag = '245' 
+           AND subfield = 'a'; 
+COMMIT;
+
 \qecho Do a partial reingest to fully populate metabib.facet_entry
 \qecho and update the keyword indexes to reflect changes in the default
 \qecho NACO normalization.  This can be time consuming on large databases.