-
Notifications
You must be signed in to change notification settings - Fork 12
/
addressing_dictionary--1.1.sql
66 lines (51 loc) · 1.74 KB
/
addressing_dictionary--1.1.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION addressing_dictionary" to load this file. \quit
------------------------------------------------------------
-- Read about how dictionaries should be ordered and what should go in
-- them https://www.postgresql.org/docs/current/textsearch-dictionaries.html
-- before mucking around with ordering or adding new languages.
--
------------------------------------------------------------
-- English configuration
--
CREATE TEXT SEARCH CONFIGURATION addressing_en (
COPY = simple
);
CREATE TEXT SEARCH DICTIONARY addressing_stop_en (
TEMPLATE = pg_catalog.simple,
STOPWORDS = addressing_en
);
CREATE TEXT SEARCH DICTIONARY addressing_syn_en (
TEMPLATE = pg_catalog.synonym,
SYNONYMS = addressing_en
);
CREATE TEXT SEARCH DICTIONARY addresses_ths_en (
TEMPLATE = pg_catalog.thesaurus,
DictFile = addressing_en,
Dictionary = simple
);
ALTER TEXT SEARCH CONFIGURATION addressing_en
ALTER MAPPING FOR asciiword, word
WITH addresses_ths_en, addressing_syn_en, addressing_stop_en;
------------------------------------------------------------
-- French configuration
--
CREATE TEXT SEARCH CONFIGURATION addressing_fr (
COPY = simple
);
CREATE TEXT SEARCH DICTIONARY addressing_stop_fr (
TEMPLATE = pg_catalog.simple,
STOPWORDS = addressing_fr
);
CREATE TEXT SEARCH DICTIONARY addressing_syn_fr (
TEMPLATE = pg_catalog.synonym,
SYNONYMS = addressing_fr
);
CREATE TEXT SEARCH DICTIONARY addresses_ths_fr (
TEMPLATE = pg_catalog.thesaurus,
DictFile = addressing_fr,
Dictionary = simple
);
ALTER TEXT SEARCH CONFIGURATION addressing_fr
ALTER MAPPING FOR asciiword, word
WITH addresses_ths_fr, addressing_syn_fr, addressing_stop_fr;