| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 |
|
| 7 | \set cfgname 'czech'
|
| 8 | \set dictname 'czech_ispell'
|
| 9 | |
| 10 | \set stemmer 'czech_stem'
|
| 11 | \set namespace 'pg_catalog'
|
| 12 |
|
| 13 | \out /dev/null
|
| 14 | \timing off
|
| 15 |
|
| 16 |
|
| 17 | SET search_path = :"namespace";
|
| 18 |
|
| 19 | |
| 20 |
|
| 21 | SELECT EXISTS (SELECT 1 FROM pg_ts_dict WHERE dictnamespace = :'namespace'::regnamespace AND dictname = :'dictname') AS has_dict;
|
| 22 | \gset
|
| 23 |
|
| 24 | \if :has_dict
|
| 25 | \echo text search dictionary :"dictname" already exists in namespace :"namespace"
|
| 26 | \else
|
| 27 | \echo creating text search dictionary :"dictname" in namespace :"namespace"
|
| 28 | CREATE TEXT SEARCH DICTIONARY :"dictname" (
|
| 29 | template = ispell,
|
| 30 | dictfile = czech,
|
| 31 | afffile = czech,
|
| 32 | stopwords = czech
|
| 33 | );
|
| 34 | COMMENT ON TEXT SEARCH DICTIONARY :"dictname" IS 'Ispell dictionary for czech language';
|
| 35 | \endif
|
| 36 |
|
| 37 | |
| 38 |
|
| 39 | \echo updating text search configuration :"cfgname" in namespace :"namespace"
|
| 40 | ALTER TEXT SEARCH CONFIGURATION :"cfgname"
|
| 41 | ALTER MAPPING FOR asciiword, asciihword, hword, hword_asciipart, hword_part, word WITH :"dictname", :"stemmer";
|