From: Mike Rylander Date: Mon, 16 Jan 2012 16:46:22 +0000 (-0500) Subject: Post-configured normalization for browse entry data X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=557c2a254cc27c757eca4fdac7ceb20705decf79;p=evergreen%2Fequinox.git Post-configured normalization for browse entry data Signed-off-by: Mike Rylander --- 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;