[open-ils-commits] r19587 - in trunk/Open-ILS/src/sql/Pg: . upgrade (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 4 22:14:49 EST 2011
Author: dbs
Date: 2011-03-04 22:14:47 -0500 (Fri, 04 Mar 2011)
New Revision: 19587
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql
Modified:
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
Correct search index definitions for subject|complete and identifier|bibcn
Dan Wells reported in LP# 729385 that the index definitions for
subject|complete and identifier|bibcn were not working, and traced
the problem to a change in how indexes are generated in 2.0+. Dropping
the trailing '//text()' on these two indexes addresses the problem.
Sites upgrading from a previous version of Evergreen 2.0 will want
to refresh the indexes after applying this schema change to enable
searches against subject|complete and identifier|bibcn to work.
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2011-03-04 20:58:27 UTC (rev 19586)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2011-03-05 03:14:47 UTC (rev 19587)
@@ -70,7 +70,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0493'); -- dbs
+INSERT INTO config.upgrade_log (version) VALUES ('0494'); -- dbs
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2011-03-04 20:58:27 UTC (rev 19586)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2011-03-05 03:14:47 UTC (rev 19587)
@@ -62,7 +62,7 @@
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
(15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */;
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
- (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject//text()$$ );
+ (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject$$ );
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
(17, 'identifier', 'accession', oils_i18n_gettext(17, 'Accession Number', 'cmf', 'label'), 'marcxml', $$//marc:controlfield[@tag='001']$$ );
@@ -81,7 +81,7 @@
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
(24, 'identifier', 'sici', oils_i18n_gettext(24, 'SICI', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='024' and ind1='4']/marc:subfield[@code='a' or @code='z']$$ );
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
- (25, 'identifier', 'bibcn', oils_i18n_gettext(25, 'Local Free-Text Call Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='099']//text()$$ );
+ (25, 'identifier', 'bibcn', oils_i18n_gettext(25, 'Local Free-Text Call Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='099']$$ );
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
(26, 'identifier', 'tcn', oils_i18n_gettext(26, 'Title Control Number', 'cmf', 'label'), 'marcxml', $$//marc:datafield[@tag='901']/marc:subfield[@code='a']$$ );
INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0494.data.search_indexes.sql 2011-03-05 03:14:47 UTC (rev 19587)
@@ -0,0 +1,13 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0494'); -- dbs
+
+UPDATE config.metabib_field
+ SET xpath = $$//mods32:mods/mods32:subject$$
+ WHERE field_class = 'subject' AND name = 'complete';
+
+UPDATE config.metabib_field
+ SET xpath = $$//marc:datafield[@tag='099']$$
+ WHERE field_class = 'identifier' AND name = 'bibcn';
+
+COMMIT;
More information about the open-ils-commits
mailing list