From: Dan Scott Date: Fri, 11 Nov 2011 18:41:33 +0000 (-0500) Subject: LP825039: Add reingest logic for non-filing titles X-Git-Tag: sprint4-merge-nov22~4627^2~3 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=77011103fbf99f1e1acf9266252ddf30d164d5ef;p=working%2FEvergreen.git LP825039: Add reingest logic for non-filing titles Rather than reindexing all titles that have a non-filing indicator, this upgrade handles the known problematic cases (apostrophes with leading articles). On our system that's 55K out of 2.2M records - not bad at all. We also ensure the format is set to MODS32 for title:proper, as sites might have customized it on a MARC basis and we don't want to reindex the records with NULL values due to a mix of format and XPath. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix-nonfiling-titles.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix-nonfiling-titles.sql index 2ab8a154ef..0b604663a0 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.fix-nonfiling-titles.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.fix-nonfiling-titles.sql @@ -20,7 +20,8 @@ SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); -- but are you really going to read through the whole XSL below before -- seeing this important bit? UPDATE config.metabib_field - SET xpath = $$//mods32:mods/mods32:titleNonfiling[mods32:title and not (@type)]$$ + SET xpath = $$//mods32:mods/mods32:titleNonfiling[mods32:title and not (@type)]$$, + format = 'mods32' WHERE field_class = 'title' AND name = 'proper'; UPDATE config.xml_transform SET xslt=$$ @@ -3143,3 +3144,13 @@ Added Log Comment $$ WHERE name = 'mods32'; COMMIT; + +-- This could take a long time if you have a very non-English bib database +-- Run it outside of a transaction to avoid lock escalation +SELECT metabib.reingest_metabib_field_entries(record) + FROM metabib.full_rec + WHERE tag = '245' + AND ind2 > '0' + AND subfield = 'a' + AND value LIKE '%''%' +;