]> git.openstreetmap.org Git - nominatim.git/blob - lib-sql/tokenizer/legacy_tokenizer_tables.sql
reintroduce cutoffs when searching for very frequent words
[nominatim.git] / lib-sql / tokenizer / legacy_tokenizer_tables.sql
1 -- SPDX-License-Identifier: GPL-2.0-only
2 --
3 -- This file is part of Nominatim. (https://nominatim.org)
4 --
5 -- Copyright (C) 2022 by the Nominatim developer community.
6 -- For a full list of authors see the git log.
7
8 DROP TABLE IF EXISTS word;
9 CREATE TABLE word (
10   word_id INTEGER,
11   word_token text NOT NULL,
12   word text,
13   class text,
14   type text,
15   country_code varchar(2),
16   search_name_count INTEGER,
17   operator TEXT
18 ) {{db.tablespace.search_data}};
19
20 CREATE INDEX idx_word_word_token ON word
21     USING BTREE (word_token) {{db.tablespace.search_index}};
22 CREATE INDEX idx_word_word ON word
23     USING BTREE (word) {{db.tablespace.search_index}} WHERE word is not null;
24 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
25
26 DROP SEQUENCE IF EXISTS seq_word;
27 CREATE SEQUENCE seq_word start 1;
28 GRANT SELECT ON seq_word to "{{config.DATABASE_WEBUSER}}";