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>
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.
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.
21 SET search_path = public, pg_catalog;
23 CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
25 NEW.index_vector = to_tsvector((TG_ARGV[0])::regconfig, NEW.value);
30 DROP TEXT SEARCH DICTIONARY IF EXISTS english_nostop CASCADE;
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.';
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 );