From: Mike Rylander Date: Tue, 20 Feb 2018 21:39:54 +0000 (-0500) Subject: LP#1744385: Fix typo and allow stemmed search and highlighting of Genre X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=fd45adb4bd298031dff98d31b571394db3a5397a;p=evergreen%2Fpines.git LP#1744385: Fix typo and allow stemmed search and highlighting of Genre Signed-off-by: Mike Rylander Signed-off-by: Kathy Lussier Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql index eee307dc4c..08ca281944 100644 --- a/Open-ILS/src/sql/Pg/300.schema.staged_search.sql +++ b/Open-ILS/src/sql/Pg/300.schema.staged_search.sql @@ -1320,7 +1320,7 @@ CREATE OR REPLACE VIEW search.best_tsconfig AS COALESCE(f.ts_config, c.ts_config, 'simple') AS ts_config FROM config.metabib_field m LEFT JOIN config.metabib_class_ts_map c ON (c.field_class = m.field_class AND c.index_weight = 'C') - LEFT JOIN config.metabib_field_ts_map f ON (f.metabib_field = m.id AND c.index_weight = 'C'); + LEFT JOIN config.metabib_field_ts_map f ON (f.metabib_field = m.id AND f.index_weight = 'C'); CREATE TYPE search.highlight_result AS ( id BIGINT, source BIGINT, field INT, value TEXT, highlight TEXT ); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql index cc3f913bea..ed5084272d 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.highlight_search.sql @@ -334,7 +334,7 @@ CREATE OR REPLACE VIEW search.best_tsconfig AS COALESCE(f.ts_config, c.ts_config, 'simple') AS ts_config FROM config.metabib_field m LEFT JOIN config.metabib_class_ts_map c ON (c.field_class = m.field_class AND c.index_weight = 'C') - LEFT JOIN config.metabib_field_ts_map f ON (f.metabib_field = m.id AND c.index_weight = 'C'); + LEFT JOIN config.metabib_field_ts_map f ON (f.metabib_field = m.id AND f.index_weight = 'C'); CREATE TYPE search.highlight_result AS ( id BIGINT, source BIGINT, field INT, value TEXT, highlight TEXT ); diff --git a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql index 1618350bbc..fb868f45de 100644 --- a/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql +++ b/Open-ILS/src/sql/Pg/upgrade/ZZZZ.data.virtual_index_defs.sql @@ -13,6 +13,13 @@ INSERT INTO config.metabib_field_virtual_map (real, virtual) UPDATE config.metabib_field SET xpath=$$//mods32:mods/mods32:subject[not(descendant::mods32:geographicCode)]$$ WHERE id = 16; +-- Stemming for genre +INSERT INTO config.metabib_field_ts_map (metabib_field, ts_config) + SELECT 33, 'english_nostop' WHERE NOT EXISTS ( + SELECT 1 FROM config.metabib_field_ts_map WHERE metabib_field = 33 AND ts_config = 'english_nostop' + ) +; + COMMIT; \qecho