From 5e469b7aaa8f84cc1f2d4926743188f9792b626a Mon Sep 17 00:00:00 2001 From: dbs Date: Tue, 15 Jul 2008 04:34:00 +0000 Subject: [PATCH] Initial stab at a PostgreSQL 8.3 full text search schema git-svn-id: svn://svn.open-ils.org/ILS/trunk@10051 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../sql/Pg/000.english.pg83.fts-config.sql | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql diff --git a/Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql b/Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql new file mode 100644 index 0000000000..b089f7794b --- /dev/null +++ b/Open-ILS/src/sql/Pg/000.english.pg83.fts-config.sql @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2004-2008 Georgia Public Library Service + * Copyright (C) 2008 Equinox Software, Inc., Laurentian University + * Mike Rylander + * Dan Scott + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + */ + +BEGIN; + +CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$ +BEGIN + NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, NEW.value); + RETURN NEW; +END; +$$ LANGUAGE PLPGSQL; + +DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop CASCADE; + +CREATE TEXT SEARCH DICTIONARY english_nostop (TEMPLATE=pg_catalog.snowball, language='english'); +COMMENT ON TEXT SEARCH DICTIONARY english_nostop IS 'English snowball stemmer with no stopwords for ASCII words only.'; + +CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english ); +ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple; +ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop; +CREATE TEXT SEARCH CONFIGURATION author ( COPY = title ); +CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title ); +CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title ); +CREATE TEXT SEARCH CONFIGURATION series ( COPY = title ); +CREATE TEXT SEARCH CONFIGURATION "default" ( COPY = title ); + +COMMIT; -- 2.43.2