From: Bill Erickson Date: Mon, 15 Jul 2019 19:37:35 +0000 (-0400) Subject: JBAS-2313 Authority index skip non-browse entries X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=21fd0fd06a0899ea868730fecb969014592e07c7;p=working%2FEvergreen.git JBAS-2313 Authority index skip non-browse entries Avoid creating browse entry links to authority fields which are not configured as browse_field's via their link to config.metabib_field or have no link to metabib_field. These entries will never appear in a browse search and they prevent bib record ingest from completing as it causes failures attempting to maintain the metabib.browse_entry.metabib_fields_cache Signed-off-by: Bill Erickson --- diff --git a/KCLS/sql/schema/deploy/stock-browse-schema.sql b/KCLS/sql/schema/deploy/stock-browse-schema.sql index 2abd7bea6c..96645bfc8a 100644 --- a/KCLS/sql/schema/deploy/stock-browse-schema.sql +++ b/KCLS/sql/schema/deploy/stock-browse-schema.sql @@ -677,6 +677,15 @@ BEGIN INSERT INTO authority.simple_heading (record,atag,value,sort_value,thesaurus) VALUES (ashs.record, ashs.atag, ashs.value, ashs.sort_value, ashs.thesaurus); + -- avoid creating browse entries for headings that are not linked + -- to browse=true metabib fields. + PERFORM 1 + FROM authority.control_set_auth_field_metabib_field_map_refs map + JOIN config.metabib_field cmf ON (cmf.id = map.metabib_field) + WHERE map.authority_field = ashs.atag AND cmf.browse_field; + + CONTINUE WHEN NOT FOUND; + ash_id := CURRVAL('authority.simple_heading_id_seq'::REGCLASS); SELECT INTO mbe_row * FROM metabib.browse_entry