mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-12-28 15:34:34 +03:00
e6c2842b66
Adds also tests for the new function to execute a SQL script.
17 lines
561 B
Python
17 lines
561 B
Python
"""
|
|
Functions for bringing auxiliary data in the database up-to-date.
|
|
"""
|
|
from ..db.utils import execute_file
|
|
|
|
def update_postcodes(conn, datadir):
|
|
""" Recalculate postcode centroids and add, remove and update entries in the
|
|
location_postcode table. `conn` is an opne connection to the database.
|
|
"""
|
|
execute_file(conn, datadir / 'sql' / 'update-postcodes.sql')
|
|
|
|
|
|
def recompute_word_counts(conn, datadir):
|
|
""" Compute the frequency of full-word search terms.
|
|
"""
|
|
execute_file(conn, datadir / 'sql' / 'words_from_search_name.sql')
|