From 557c2a254cc27c757eca4fdac7ceb20705decf79 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Mon, 16 Jan 2012 11:46:22 -0500 Subject: [PATCH] Post-configured normalization for browse entry data Signed-off-by: Mike Rylander --- Open-ILS/src/sql/Pg/002.schema.config.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 9bcec9de0d..6dcdd6cbff 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -805,12 +805,12 @@ BEGIN END LOOP; END IF; - IF REGEXP_REPLACE(VERSION(),E'^.+?(\\d+\\.\\d+).*?$',E'\\1')::FLOAT > 8.2 THEN - NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, value); - ELSE - NEW.index_vector = to_tsvector(TG_ARGV[0], value); + IF TG_TABLE_NAME::TEXT ~ 'browse_entry$' THEN + value := ARRAY_TO_STRING(regexp_split_to_array(value, E'\\W+'), ' '); END IF; + NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, value); + RETURN NEW; END; $$ LANGUAGE PLPGSQL; -- 2.11.0