]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-sql/tokenizer/icu_tokenizer_tables.sql
icu tokenizer: switch to matching against partial names
[nominatim.git] / lib-sql / tokenizer / icu_tokenizer_tables.sql
index 13b12797445ed27d97110191a007eb6baf2bb6e2..7ec3c6f891c958d5eb43de3df91faba6ea30a37c 100644 (file)
@@ -1,8 +1,9 @@
 DROP TABLE IF EXISTS word;
-CREATE TABLE word_icu (
+CREATE TABLE word (
   word_id INTEGER,
   word_token text NOT NULL,
   type text NOT NULL,
+  word text,
   info jsonb
 ) {{db.tablespace.search_data}};
 
@@ -10,15 +11,15 @@ CREATE INDEX idx_word_word_token ON word
     USING BTREE (word_token) {{db.tablespace.search_index}};
 -- Used when updating country names from the boundary relation.
 CREATE INDEX idx_word_country_names ON word
-    USING btree((info->>'cc')) {{db.tablespace.address_index}}
+    USING btree(word) {{db.tablespace.address_index}}
     WHERE type = 'C';
 -- Used when inserting new postcodes on updates.
 CREATE INDEX idx_word_postcodes ON word
-    USING btree((info->>'postcode')) {{db.tablespace.address_index}}
+    USING btree(word) {{db.tablespace.address_index}}
     WHERE type = 'P';
 -- Used when inserting full words.
 CREATE INDEX idx_word_full_word ON word
-    USING btree((info->>'word')) {{db.tablespace.address_index}}
+    USING btree(word) {{db.tablespace.address_index}}
     WHERE type = 'W';
 
 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";