]> git.openstreetmap.org Git - nominatim.git/blob - lib-sql/tokenizer/icu_tokenizer_tables.sql
1d70a9c38e8b86b8600aad4dd809f1fe6a0eded9
[nominatim.git] / lib-sql / tokenizer / icu_tokenizer_tables.sql
1 DROP TABLE IF EXISTS word;
2 CREATE TABLE word_icu (
3   word_id INTEGER,
4   word_token text NOT NULL,
5   type text NOT NULL,
6   info jsonb
7 ) {{db.tablespace.search_data}};
8
9 CREATE INDEX idx_word_word_token ON word
10     USING BTREE (word_token) {{db.tablespace.search_index}};
11 -- Used when updating country names from the boundary relation.
12 CREATE INDEX idx_word_country_names ON word
13     USING btree((info->>'cc')) WHERE type = 'C';
14 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
15
16 DROP SEQUENCE IF EXISTS seq_word;
17 CREATE SEQUENCE seq_word start 1;
18 GRANT SELECT ON seq_word to "{{config.DATABASE_WEBUSER}}";