]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/sql/Pg/000.english.pg90.fts-config.sql
Merge branch 'master' of git.evergreen-ils.org:Evergreen-DocBook into doc_consolidati...
[Evergreen.git] / Open-ILS / src / sql / Pg / 000.english.pg90.fts-config.sql
1 /*
2  * Copyright (C) 2004-2008  Georgia Public Library Service
3  * Copyright (C) 2008  Equinox Software, Inc., Laurentian University
4  * Mike Rylander <miker@esilibrary.com>
5  * Dan Scott <dscott@laurentian.ca>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  */
18
19 BEGIN;
20
21 SET search_path = public, pg_catalog;
22
23 CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
24 BEGIN
25         NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, NEW.value);
26         RETURN NEW;
27 END;
28 $$ LANGUAGE PLPGSQL;
29
30 DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop CASCADE;
31
32 CREATE TEXT SEARCH DICTIONARY english_nostop (TEMPLATE=pg_catalog.snowball, language='english');
33 COMMENT ON TEXT SEARCH DICTIONARY english_nostop IS 'English snowball stemmer with no stopwords for ASCII words only.';
34
35 CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
36 ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
37 ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH english_nostop;
38 CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
39 CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
40 CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
41 CREATE TEXT SEARCH CONFIGURATION identifier ( COPY = title );
42 CREATE TEXT SEARCH CONFIGURATION series ( COPY = title );
43 CREATE TEXT SEARCH CONFIGURATION "default" ( COPY = title );
44
45 COMMIT;