]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/000.english.pg82.fts-config.sql
Merge Dan Wells' changes to the serial schema from the
[working/Evergreen.git] / Open-ILS / src / sql / Pg / 000.english.pg82.fts-config.sql
1 /*
2  * Copyright (C) 2004-2008  Georgia Public Library Service
3  * Copyright (C) 2008  Equinox Software, Inc.
4  * Mike Rylander <miker@esilibrary.com>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17
18
19 BEGIN;
20
21 CREATE OR REPLACE FUNCTION oils_tsearch2 () RETURNS TRIGGER AS $$
22 BEGIN
23         NEW.index_vector = to_tsvector(TG_ARGV[0], NEW.value);
24         RETURN NEW;
25 END;
26 $$ LANGUAGE PLPGSQL;
27
28 INSERT INTO pg_ts_cfg VALUES ('title', 'default','C');
29 INSERT INTO pg_ts_cfg VALUES ('author', 'default','C');
30 INSERT INTO pg_ts_cfg VALUES ('subject', 'default','C');
31 INSERT INTO pg_ts_cfg VALUES ('keyword', 'default','C');
32 INSERT INTO pg_ts_cfg VALUES ('identifier', 'default','C');
33 INSERT INTO pg_ts_cfg VALUES ('series', 'default','C');
34
35 INSERT INTO pg_ts_dict VALUES ('en_stem_nostop', 'snb_en_init(internal)', '', 'snb_lexize(internal,internal,integer)', 'English Stemmer. Snowball. No stop words.');
36
37 INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlword', '{simple}');
38 INSERT INTO pg_ts_cfgmap VALUES ('title', 'word', '{simple}');
39 INSERT INTO pg_ts_cfgmap VALUES ('title', 'email', '{simple}');
40 INSERT INTO pg_ts_cfgmap VALUES ('title', 'url', '{simple}');
41 INSERT INTO pg_ts_cfgmap VALUES ('title', 'host', '{simple}');
42 INSERT INTO pg_ts_cfgmap VALUES ('title', 'sfloat', '{simple}');
43 INSERT INTO pg_ts_cfgmap VALUES ('title', 'version', '{simple}');
44 INSERT INTO pg_ts_cfgmap VALUES ('title', 'part_hword', '{simple}');
45 INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlpart_hword', '{simple}');
46 INSERT INTO pg_ts_cfgmap VALUES ('title', 'hword', '{simple}');
47 INSERT INTO pg_ts_cfgmap VALUES ('title', 'nlhword', '{simple}');
48 INSERT INTO pg_ts_cfgmap VALUES ('title', 'uri', '{simple}');
49 INSERT INTO pg_ts_cfgmap VALUES ('title', 'file', '{simple}');
50 INSERT INTO pg_ts_cfgmap VALUES ('title', 'float', '{simple}');
51 INSERT INTO pg_ts_cfgmap VALUES ('title', 'int', '{simple}');
52 INSERT INTO pg_ts_cfgmap VALUES ('title', 'uint', '{simple}');
53 INSERT INTO pg_ts_cfgmap VALUES ('title', 'lword', '{en_stem_nostop}');
54 INSERT INTO pg_ts_cfgmap VALUES ('title', 'lpart_hword', '{en_stem_nostop}');
55 INSERT INTO pg_ts_cfgmap VALUES ('title', 'lhword', '{en_stem_nostop}');
56
57 INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlword', '{simple}');
58 INSERT INTO pg_ts_cfgmap VALUES ('author', 'word', '{simple}');
59 INSERT INTO pg_ts_cfgmap VALUES ('author', 'email', '{simple}');
60 INSERT INTO pg_ts_cfgmap VALUES ('author', 'url', '{simple}');
61 INSERT INTO pg_ts_cfgmap VALUES ('author', 'host', '{simple}');
62 INSERT INTO pg_ts_cfgmap VALUES ('author', 'sfloat', '{simple}');
63 INSERT INTO pg_ts_cfgmap VALUES ('author', 'version', '{simple}');
64 INSERT INTO pg_ts_cfgmap VALUES ('author', 'part_hword', '{simple}');
65 INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlpart_hword', '{simple}');
66 INSERT INTO pg_ts_cfgmap VALUES ('author', 'hword', '{simple}');
67 INSERT INTO pg_ts_cfgmap VALUES ('author', 'nlhword', '{simple}');
68 INSERT INTO pg_ts_cfgmap VALUES ('author', 'uri', '{simple}');
69 INSERT INTO pg_ts_cfgmap VALUES ('author', 'file', '{simple}');
70 INSERT INTO pg_ts_cfgmap VALUES ('author', 'float', '{simple}');
71 INSERT INTO pg_ts_cfgmap VALUES ('author', 'int', '{simple}');
72 INSERT INTO pg_ts_cfgmap VALUES ('author', 'uint', '{simple}');
73 INSERT INTO pg_ts_cfgmap VALUES ('author', 'lword', '{en_stem_nostop}');
74 INSERT INTO pg_ts_cfgmap VALUES ('author', 'lpart_hword', '{en_stem_nostop}');
75 INSERT INTO pg_ts_cfgmap VALUES ('author', 'lhword', '{en_stem_nostop}');
76
77 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlword', '{simple}');
78 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'word', '{simple}');
79 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'email', '{simple}');
80 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'url', '{simple}');
81 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'host', '{simple}');
82 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'sfloat', '{simple}');
83 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'version', '{simple}');
84 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'part_hword', '{simple}');
85 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlpart_hword', '{simple}');
86 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'hword', '{simple}');
87 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'nlhword', '{simple}');
88 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uri', '{simple}');
89 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'file', '{simple}');
90 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'float', '{simple}');
91 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'int', '{simple}');
92 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'uint', '{simple}');
93 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lword', '{en_stem_nostop}');
94 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lpart_hword', '{en_stem_nostop}');
95 INSERT INTO pg_ts_cfgmap VALUES ('subject', 'lhword', '{en_stem_nostop}');
96
97 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlword', '{simple}');
98 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'word', '{simple}');
99 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'email', '{simple}');
100 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'url', '{simple}');
101 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'host', '{simple}');
102 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'sfloat', '{simple}');
103 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'version', '{simple}');
104 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'part_hword', '{simple}');
105 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlpart_hword', '{simple}');
106 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'hword', '{simple}');
107 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlhword', '{simple}');
108 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uri', '{simple}');
109 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'file', '{simple}');
110 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'float', '{simple}');
111 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'int', '{simple}');
112 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uint', '{simple}');
113 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lword', '{en_stem_nostop}');
114 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lpart_hword', '{en_stem_nostop}');
115 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lhword', '{en_stem_nostop}');
116
117 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlword', '{simple}');
118 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'word', '{simple}');
119 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'email', '{simple}');
120 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'url', '{simple}');
121 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'host', '{simple}');
122 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'sfloat', '{simple}');
123 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'version', '{simple}');
124 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'part_hword', '{simple}');
125 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlpart_hword', '{simple}');
126 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'hword', '{simple}');
127 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'nlhword', '{simple}');
128 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uri', '{simple}');
129 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'file', '{simple}');
130 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'float', '{simple}');
131 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'int', '{simple}');
132 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'uint', '{simple}');
133 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lword', '{en_stem_nostop}');
134 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lpart_hword', '{en_stem_nostop}');
135 INSERT INTO pg_ts_cfgmap VALUES ('keyword', 'lhword', '{en_stem_nostop}');
136
137 INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlword', '{simple}');
138 INSERT INTO pg_ts_cfgmap VALUES ('series', 'word', '{simple}');
139 INSERT INTO pg_ts_cfgmap VALUES ('series', 'email', '{simple}');
140 INSERT INTO pg_ts_cfgmap VALUES ('series', 'url', '{simple}');
141 INSERT INTO pg_ts_cfgmap VALUES ('series', 'host', '{simple}');
142 INSERT INTO pg_ts_cfgmap VALUES ('series', 'sfloat', '{simple}');
143 INSERT INTO pg_ts_cfgmap VALUES ('series', 'version', '{simple}');
144 INSERT INTO pg_ts_cfgmap VALUES ('series', 'part_hword', '{simple}');
145 INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlpart_hword', '{simple}');
146 INSERT INTO pg_ts_cfgmap VALUES ('series', 'hword', '{simple}');
147 INSERT INTO pg_ts_cfgmap VALUES ('series', 'nlhword', '{simple}');
148 INSERT INTO pg_ts_cfgmap VALUES ('series', 'uri', '{simple}');
149 INSERT INTO pg_ts_cfgmap VALUES ('series', 'file', '{simple}');
150 INSERT INTO pg_ts_cfgmap VALUES ('series', 'float', '{simple}');
151 INSERT INTO pg_ts_cfgmap VALUES ('series', 'int', '{simple}');
152 INSERT INTO pg_ts_cfgmap VALUES ('series', 'uint', '{simple}');
153 INSERT INTO pg_ts_cfgmap VALUES ('series', 'lword', '{en_stem_nostop}');
154 INSERT INTO pg_ts_cfgmap VALUES ('series', 'lpart_hword', '{en_stem_nostop}');
155 INSERT INTO pg_ts_cfgmap VALUES ('series', 'lhword', '{en_stem_nostop}');
156
157 SELECT set_curcfg('default');
158
159 COMMIT;