[open-ils-commits] [GIT] Evergreen ILS branch master updated. 87846cfc29f7aa3de474ee31db41eafd7918fad0
Evergreen Git
git at git.evergreen-ils.org
Tue Feb 27 16:32:37 EST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 87846cfc29f7aa3de474ee31db41eafd7918fad0 (commit)
via a820163ae3a3cd55a4e79f1260ddf28b4358cfe2 (commit)
via a8759bad5eb58a226a9b6957d9acb1cd4630f10c (commit)
from 3c1b6d0a129a45e6073e78cdeaaf2c59515b83cd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 87846cfc29f7aa3de474ee31db41eafd7918fad0
Author: Kathy Lussier <klussier at masslnc.org>
Date: Tue Feb 27 16:29:51 2018 -0500
LP#1733695: Stamping upgrade scripts for multilingual search
Also, fixed a small typo in the 1094 upgrade script.
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index b230584..2a72ffe 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -92,7 +92,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1091', :eg_version); -- jboyer/dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('1094', :eg_version); -- miker/kmlussier
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql b/Open-ILS/src/sql/Pg/upgrade/1092.schema.ingest_multiple_sources.sql
similarity index 99%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
rename to Open-ILS/src/sql/Pg/upgrade/1092.schema.ingest_multiple_sources.sql
index f9e4e09..79f442e 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1092.schema.ingest_multiple_sources.sql
@@ -1,6 +1,6 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1092', :eg_version);
CREATE OR REPLACE FUNCTION metabib.reingest_record_attributes (rid BIGINT, pattr_list TEXT[] DEFAULT NULL, prmarc TEXT DEFAULT NULL, rdeleted BOOL DEFAULT TRUE) RETURNS VOID AS $func$
DECLARE
diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql b/Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
similarity index 65%
rename from Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
rename to Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
index 94e7496..c2712ce 100644
--- a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
@@ -1,6 +1,6 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('YYYY', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1093', :eg_version);
UPDATE config.record_attr_definition SET tag = '041', sf_list = 'abdefgm' where name = 'item_lang';
diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql b/Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
similarity index 70%
rename from Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
rename to Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
index 0ea1869..14fc9be 100644
--- a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
@@ -1,9 +1,9 @@
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('ZZZZ', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('1094', :eg_version);
SELECT metabib.reingest_record_attributes (record, '{item_lang}'::TEXT[])
- FROM (SELECT DINSTINCT record
+ FROM (SELECT DISTINCT record
FROM metabib.real_full_rec
WHERE tag = '041'
AND subfield IN ('a','b','d','e','f','g','m')
commit a820163ae3a3cd55a4e79f1260ddf28b4358cfe2
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Feb 27 15:48:01 2018 -0500
Add release note for multilingual search
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc b/docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
new file mode 100644
index 0000000..425654f
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
@@ -0,0 +1,17 @@
+Multi-source Attributes
+^^^^^^^^^^^^^^^^^^^^^^^
+We now allow record attribute definitions to extract data using more than
+one strategy (XPath, tag+subfield, fixed field, etc) as long as the values
+from various sources would, after normalization, have the same shape.
+
+Multilingual Search
++++++++++++++++++++
+This change allows us to configure multilingual search, by extracting values
+from both the 008 controlfield and the 041 datafield. Because the values
+in each can be normalized to the same controlled list (and, in practice, are
+already from the same normalized value set), OPAC searches can now use normal
+boolean search semantics to find records with various combinations of
+language attributes.
+
+Eg., in the concerto test data: keyword: piano item_lang(eng) item_lang(ita)
+
commit a8759bad5eb58a226a9b6957d9acb1cd4630f10c
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Nov 8 16:26:10 2017 -0500
LP#1733695: Pull record attribute values from multiple sources
Previously, a multi-valued record attribute could only be extracted using
one strategy (XPath, tag+subfield, fixed field, etc). For multi-valued
attributes, though, there's no reason to restrict this as long as the values
from various sources would, after normalization, have the same shape. So
now we allow that, and we update the item_lang definition in order to allow
searching for records with multiple languages in various boolean ways.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Kathy Lussier <klussier at masslnc.org>
diff --git a/Open-ILS/src/sql/Pg/030.schema.metabib.sql b/Open-ILS/src/sql/Pg/030.schema.metabib.sql
index f55905d..499073b 100644
--- a/Open-ILS/src/sql/Pg/030.schema.metabib.sql
+++ b/Open-ILS/src/sql/Pg/030.schema.metabib.sql
@@ -1521,8 +1521,10 @@ DECLARE
attr_value TEXT[];
norm_attr_value TEXT[];
tmp_xml TEXT;
+ tmp_array TEXT[];
attr_def config.record_attr_definition%ROWTYPE;
ccvm_row config.coded_value_map%ROWTYPE;
+ jump_past BOOL;
BEGIN
IF attr_list IS NULL OR rdeleted THEN -- need to do the full dance on INSERT or undelete
@@ -1544,15 +1546,15 @@ BEGIN
FOR attr_def IN SELECT * FROM config.record_attr_definition WHERE NOT composite AND name = ANY( attr_list ) ORDER BY format LOOP
+ jump_past := FALSE; -- This gets set when we are non-multi and have found something
attr_value := '{}'::TEXT[];
norm_attr_value := '{}'::TEXT[];
attr_vector_tmp := '{}'::INT[];
SELECT * INTO ccvm_row FROM config.coded_value_map c WHERE c.ctype = attr_def.name LIMIT 1;
- -- tag+sf attrs only support SVF
IF attr_def.tag IS NOT NULL THEN -- tag (and optional subfield list) selection
- SELECT ARRAY[ARRAY_TO_STRING(ARRAY_AGG(value), COALESCE(attr_def.joiner,' '))] INTO attr_value
+ SELECT ARRAY_AGG(value) INTO attr_value
FROM (SELECT * FROM metabib.full_rec ORDER BY tag, subfield) AS x
WHERE record = rid
AND tag LIKE attr_def.tag
@@ -1562,17 +1564,24 @@ BEGIN
ELSE TRUE
END
GROUP BY tag
- ORDER BY tag
- LIMIT 1;
+ ORDER BY tag;
- ELSIF attr_def.fixed_field IS NOT NULL THEN -- a named fixed field, see config.marc21_ff_pos_map.fixed_field
- attr_value := vandelay.marc21_extract_fixed_field_list(rmarc, attr_def.fixed_field);
+ IF NOT attr_def.multi THEN
+ attr_value := ARRAY[ARRAY_TO_STRING(attr_value, COALESCE(attr_def.joiner,' '))];
+ jump_past := TRUE;
+ END IF;
+ END IF;
+
+ IF NOT jump_past AND attr_def.fixed_field IS NOT NULL THEN -- a named fixed field, see config.marc21_ff_pos_map.fixed_field
+ attr_value := attr_value || vandelay.marc21_extract_fixed_field_list(rmarc, attr_def.fixed_field);
IF NOT attr_def.multi THEN
attr_value := ARRAY[attr_value[1]];
+ jump_past := TRUE;
END IF;
+ END IF;
- ELSIF attr_def.xpath IS NOT NULL THEN -- and xpath expression
+ IF NOT jump_past AND attr_def.xpath IS NOT NULL THEN -- and xpath expression
SELECT INTO xfrm * FROM config.xml_transform WHERE name = attr_def.format;
@@ -1606,14 +1615,17 @@ BEGIN
EXIT WHEN NOT attr_def.multi;
END IF;
END LOOP;
+ END IF;
- ELSIF attr_def.phys_char_sf IS NOT NULL THEN -- a named Physical Characteristic, see config.marc21_physical_characteristic_*_map
- SELECT ARRAY_AGG(m.value) INTO attr_value
+ IF NOT jump_past AND attr_def.phys_char_sf IS NOT NULL THEN -- a named Physical Characteristic, see config.marc21_physical_characteristic_*_map
+ SELECT ARRAY_AGG(m.value) INTO tmp_array
FROM vandelay.marc21_physical_characteristics(rmarc) v
LEFT JOIN config.marc21_physical_characteristic_value_map m ON (m.id = v.value)
WHERE v.subfield = attr_def.phys_char_sf AND (m.value IS NOT NULL AND BTRIM(m.value) <> '')
AND ( ccvm_row.id IS NULL OR ( ccvm_row.id IS NOT NULL AND v.id IS NOT NULL) );
+ attr_value := attr_value || tmp_array;
+
IF NOT attr_def.multi THEN
attr_value := ARRAY[attr_value[1]];
END IF;
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index e4379df..6dec723 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -6490,7 +6490,7 @@ INSERT INTO config.record_attr_definition (name,label,fixed_field,description) v
INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('gpub','GPub','GPub');
INSERT INTO config.record_attr_definition (name,label,fixed_field,composite) values ('ills','Ills','Ills',TRUE);
INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('indx','Indx','Indx');
-INSERT INTO config.record_attr_definition (name,label,fixed_field,description) values ('item_lang','Lang','Lang',oils_i18n_gettext('item_lang', 'Language', 'crad', 'description'));
+INSERT INTO config.record_attr_definition (name,label,fixed_field,tag,sf_list,description) values ('item_lang','Lang','Lang','041','abdefgm',oils_i18n_gettext('item_lang', 'Language', 'crad', 'description'));
INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('language','Language (2.0 compat version)','Lang');
INSERT INTO config.record_attr_definition (name,label,fixed_field,description) values ('lit_form','LitF','LitF',oils_i18n_gettext('lit_form', 'Literary Form', 'crad', 'description'));
INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('mrec','MRec','MRec');
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
new file mode 100644
index 0000000..f9e4e09
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.ingest_multiple_sources.sql
@@ -0,0 +1,242 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+CREATE OR REPLACE FUNCTION metabib.reingest_record_attributes (rid BIGINT, pattr_list TEXT[] DEFAULT NULL, prmarc TEXT DEFAULT NULL, rdeleted BOOL DEFAULT TRUE) RETURNS VOID AS $func$
+DECLARE
+ transformed_xml TEXT;
+ rmarc TEXT := prmarc;
+ tmp_val TEXT;
+ prev_xfrm TEXT;
+ normalizer RECORD;
+ xfrm config.xml_transform%ROWTYPE;
+ attr_vector INT[] := '{}'::INT[];
+ attr_vector_tmp INT[];
+ attr_list TEXT[] := pattr_list;
+ attr_value TEXT[];
+ norm_attr_value TEXT[];
+ tmp_xml TEXT;
+ tmp_array TEXT[];
+ attr_def config.record_attr_definition%ROWTYPE;
+ ccvm_row config.coded_value_map%ROWTYPE;
+ jump_past BOOL;
+BEGIN
+
+ IF attr_list IS NULL OR rdeleted THEN -- need to do the full dance on INSERT or undelete
+ SELECT ARRAY_AGG(name) INTO attr_list FROM config.record_attr_definition
+ WHERE (
+ tag IS NOT NULL OR
+ fixed_field IS NOT NULL OR
+ xpath IS NOT NULL OR
+ phys_char_sf IS NOT NULL OR
+ composite
+ ) AND (
+ filter OR sorter
+ );
+ END IF;
+
+ IF rmarc IS NULL THEN
+ SELECT marc INTO rmarc FROM biblio.record_entry WHERE id = rid;
+ END IF;
+
+ FOR attr_def IN SELECT * FROM config.record_attr_definition WHERE NOT composite AND name = ANY( attr_list ) ORDER BY format LOOP
+
+ jump_past := FALSE; -- This gets set when we are non-multi and have found something
+ attr_value := '{}'::TEXT[];
+ norm_attr_value := '{}'::TEXT[];
+ attr_vector_tmp := '{}'::INT[];
+
+ SELECT * INTO ccvm_row FROM config.coded_value_map c WHERE c.ctype = attr_def.name LIMIT 1;
+
+ IF attr_def.tag IS NOT NULL THEN -- tag (and optional subfield list) selection
+ SELECT ARRAY_AGG(value) INTO attr_value
+ FROM (SELECT * FROM metabib.full_rec ORDER BY tag, subfield) AS x
+ WHERE record = rid
+ AND tag LIKE attr_def.tag
+ AND CASE
+ WHEN attr_def.sf_list IS NOT NULL
+ THEN POSITION(subfield IN attr_def.sf_list) > 0
+ ELSE TRUE
+ END
+ GROUP BY tag
+ ORDER BY tag;
+
+ IF NOT attr_def.multi THEN
+ attr_value := ARRAY[ARRAY_TO_STRING(attr_value, COALESCE(attr_def.joiner,' '))];
+ jump_past := TRUE;
+ END IF;
+ END IF;
+
+ IF NOT jump_past AND attr_def.fixed_field IS NOT NULL THEN -- a named fixed field, see config.marc21_ff_pos_map.fixed_field
+ attr_value := attr_value || vandelay.marc21_extract_fixed_field_list(rmarc, attr_def.fixed_field);
+
+ IF NOT attr_def.multi THEN
+ attr_value := ARRAY[attr_value[1]];
+ jump_past := TRUE;
+ END IF;
+ END IF;
+
+ IF NOT jump_past AND attr_def.xpath IS NOT NULL THEN -- and xpath expression
+
+ SELECT INTO xfrm * FROM config.xml_transform WHERE name = attr_def.format;
+
+ -- See if we can skip the XSLT ... it's expensive
+ IF prev_xfrm IS NULL OR prev_xfrm <> xfrm.name THEN
+ -- Can't skip the transform
+ IF xfrm.xslt <> '---' THEN
+ transformed_xml := oils_xslt_process(rmarc,xfrm.xslt);
+ ELSE
+ transformed_xml := rmarc;
+ END IF;
+
+ prev_xfrm := xfrm.name;
+ END IF;
+
+ IF xfrm.name IS NULL THEN
+ -- just grab the marcxml (empty) transform
+ SELECT INTO xfrm * FROM config.xml_transform WHERE xslt = '---' LIMIT 1;
+ prev_xfrm := xfrm.name;
+ END IF;
+
+ FOR tmp_xml IN SELECT UNNEST(oils_xpath(attr_def.xpath, transformed_xml, ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]])) LOOP
+ tmp_val := oils_xpath_string(
+ '//*',
+ tmp_xml,
+ COALESCE(attr_def.joiner,' '),
+ ARRAY[ARRAY[xfrm.prefix, xfrm.namespace_uri]]
+ );
+ IF tmp_val IS NOT NULL AND BTRIM(tmp_val) <> '' THEN
+ attr_value := attr_value || tmp_val;
+ EXIT WHEN NOT attr_def.multi;
+ END IF;
+ END LOOP;
+ END IF;
+
+ IF NOT jump_past AND attr_def.phys_char_sf IS NOT NULL THEN -- a named Physical Characteristic, see config.marc21_physical_characteristic_*_map
+ SELECT ARRAY_AGG(m.value) INTO tmp_array
+ FROM vandelay.marc21_physical_characteristics(rmarc) v
+ LEFT JOIN config.marc21_physical_characteristic_value_map m ON (m.id = v.value)
+ WHERE v.subfield = attr_def.phys_char_sf AND (m.value IS NOT NULL AND BTRIM(m.value) <> '')
+ AND ( ccvm_row.id IS NULL OR ( ccvm_row.id IS NOT NULL AND v.id IS NOT NULL) );
+
+ attr_value := attr_value || tmp_array;
+
+ IF NOT attr_def.multi THEN
+ attr_value := ARRAY[attr_value[1]];
+ END IF;
+
+ END IF;
+
+ -- apply index normalizers to attr_value
+ FOR tmp_val IN SELECT value FROM UNNEST(attr_value) x(value) LOOP
+ FOR normalizer IN
+ SELECT n.func AS func,
+ n.param_count AS param_count,
+ m.params AS params
+ FROM config.index_normalizer n
+ JOIN config.record_attr_index_norm_map m ON (m.norm = n.id)
+ WHERE attr = attr_def.name
+ ORDER BY m.pos LOOP
+ EXECUTE 'SELECT ' || normalizer.func || '(' ||
+ COALESCE( quote_literal( tmp_val ), 'NULL' ) ||
+ CASE
+ WHEN normalizer.param_count > 0
+ THEN ',' || REPLACE(REPLACE(BTRIM(normalizer.params,'[]'),E'\'',E'\\\''),E'"',E'\'')
+ ELSE ''
+ END ||
+ ')' INTO tmp_val;
+
+ END LOOP;
+ IF tmp_val IS NOT NULL AND tmp_val <> '' THEN
+ -- note that a string that contains only blanks
+ -- is a valid value for some attributes
+ norm_attr_value := norm_attr_value || tmp_val;
+ END IF;
+ END LOOP;
+
+ IF attr_def.filter THEN
+ -- Create unknown uncontrolled values and find the IDs of the values
+ IF ccvm_row.id IS NULL THEN
+ FOR tmp_val IN SELECT value FROM UNNEST(norm_attr_value) x(value) LOOP
+ IF tmp_val IS NOT NULL AND BTRIM(tmp_val) <> '' THEN
+ BEGIN -- use subtransaction to isolate unique constraint violations
+ INSERT INTO metabib.uncontrolled_record_attr_value ( attr, value ) VALUES ( attr_def.name, tmp_val );
+ EXCEPTION WHEN unique_violation THEN END;
+ END IF;
+ END LOOP;
+
+ SELECT ARRAY_AGG(id) INTO attr_vector_tmp FROM metabib.uncontrolled_record_attr_value WHERE attr = attr_def.name AND value = ANY( norm_attr_value );
+ ELSE
+ SELECT ARRAY_AGG(id) INTO attr_vector_tmp FROM config.coded_value_map WHERE ctype = attr_def.name AND code = ANY( norm_attr_value );
+ END IF;
+
+ -- Add the new value to the vector
+ attr_vector := attr_vector || attr_vector_tmp;
+ END IF;
+
+ IF attr_def.sorter THEN
+ DELETE FROM metabib.record_sorter WHERE source = rid AND attr = attr_def.name;
+ IF norm_attr_value[1] IS NOT NULL THEN
+ INSERT INTO metabib.record_sorter (source, attr, value) VALUES (rid, attr_def.name, norm_attr_value[1]);
+ END IF;
+ END IF;
+
+ END LOOP;
+
+/* We may need to rewrite the vlist to contain
+ the intersection of new values for requested
+ attrs and old values for ignored attrs. To
+ do this, we take the old attr vlist and
+ subtract any values that are valid for the
+ requested attrs, and then add back the new
+ set of attr values. */
+
+ IF ARRAY_LENGTH(pattr_list, 1) > 0 THEN
+ SELECT vlist INTO attr_vector_tmp FROM metabib.record_attr_vector_list WHERE source = rid;
+ SELECT attr_vector_tmp - ARRAY_AGG(id::INT) INTO attr_vector_tmp FROM metabib.full_attr_id_map WHERE attr = ANY (pattr_list);
+ attr_vector := attr_vector || attr_vector_tmp;
+ END IF;
+
+ -- On to composite attributes, now that the record attrs have been pulled. Processed in name order, so later composite
+ -- attributes can depend on earlier ones.
+ PERFORM metabib.compile_composite_attr_cache_init();
+ FOR attr_def IN SELECT * FROM config.record_attr_definition WHERE composite AND name = ANY( attr_list ) ORDER BY name LOOP
+
+ FOR ccvm_row IN SELECT * FROM config.coded_value_map c WHERE c.ctype = attr_def.name ORDER BY value LOOP
+
+ tmp_val := metabib.compile_composite_attr( ccvm_row.id );
+ CONTINUE WHEN tmp_val IS NULL OR tmp_val = ''; -- nothing to do
+
+ IF attr_def.filter THEN
+ IF attr_vector @@ tmp_val::query_int THEN
+ attr_vector = attr_vector + intset(ccvm_row.id);
+ EXIT WHEN NOT attr_def.multi;
+ END IF;
+ END IF;
+
+ IF attr_def.sorter THEN
+ IF attr_vector @@ tmp_val THEN
+ DELETE FROM metabib.record_sorter WHERE source = rid AND attr = attr_def.name;
+ INSERT INTO metabib.record_sorter (source, attr, value) VALUES (rid, attr_def.name, ccvm_row.code);
+ END IF;
+ END IF;
+
+ END LOOP;
+
+ END LOOP;
+
+ IF ARRAY_LENGTH(attr_vector, 1) > 0 THEN
+ IF rdeleted THEN -- initial insert OR revivication
+ DELETE FROM metabib.record_attr_vector_list WHERE source = rid;
+ INSERT INTO metabib.record_attr_vector_list (source, vlist) VALUES (rid, attr_vector);
+ ELSE
+ UPDATE metabib.record_attr_vector_list SET vlist = attr_vector WHERE source = rid;
+ END IF;
+ END IF;
+
+END;
+
+$func$ LANGUAGE PLPGSQL;
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
new file mode 100644
index 0000000..94e7496
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/YYYY.data.multiple_language_search.sql
@@ -0,0 +1,8 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('YYYY', :eg_version);
+
+UPDATE config.record_attr_definition SET tag = '041', sf_list = 'abdefgm' where name = 'item_lang';
+
+COMMIT;
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
new file mode 100644
index 0000000..0ea1869
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.reingest.multiple_language_search.sql
@@ -0,0 +1,13 @@
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('ZZZZ', :eg_version);
+
+SELECT metabib.reingest_record_attributes (record, '{item_lang}'::TEXT[])
+ FROM (SELECT DINSTINCT record
+ FROM metabib.real_full_rec
+ WHERE tag = '041'
+ AND subfield IN ('a','b','d','e','f','g','m')
+ ) x;
+
+COMMIT;
+
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/030.schema.metabib.sql | 30 ++++++++++++-----
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 2 +-
...sql => 1092.schema.ingest_multiple_sources.sql} | 35 +++++++++++++-------
.../Pg/upgrade/1093.data.multiple_language_search | 8 ++++
.../1094.reingest.multiple_language_search.sql | 13 +++++++
.../OPAC/multilingual_search.adoc | 17 +++++++++
7 files changed, 84 insertions(+), 23 deletions(-)
copy Open-ILS/src/sql/Pg/upgrade/{0985.schema.speed_record_attr_ingest.sql => 1092.schema.ingest_multiple_sources.sql} (88%)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/1093.data.multiple_language_search
create mode 100644 Open-ILS/src/sql/Pg/upgrade/1094.reingest.multiple_language_search.sql
create mode 100644 docs/RELEASE_NOTES_NEXT/OPAC/multilingual_search.adoc
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list