mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-18 10:32:08 +03:00
b9517c99ae
Also introduces a separate constant for the sql directory, so that it can be put separately from the rest of the data if required.
12 lines
349 B
SQL
12 lines
349 B
SQL
DROP TABLE IF EXISTS word_frequencies;
|
|
CREATE TABLE word_frequencies AS
|
|
SELECT unnest(name_vector) as id, count(*) FROM search_name GROUP BY id;
|
|
|
|
CREATE INDEX idx_word_frequencies ON word_frequencies(id);
|
|
|
|
UPDATE word SET search_name_count = count
|
|
FROM word_frequencies
|
|
WHERE word_token like ' %' and word_id = id;
|
|
|
|
DROP TABLE word_frequencies;
|