rewrite importances in search_name after updating in placex

This commit is contained in:
Sarah Hoffmann
2025-06-26 20:27:37 +02:00
parent f97a0a76f2
commit 678702ceb7
3 changed files with 28 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
#
# This file is part of Nominatim. (https://nominatim.org)
#
# Copyright (C) 2024 by the Nominatim developer community.
# Copyright (C) 2025 by the Nominatim developer community.
# For a full list of authors see the git log.
"""
Functions for bringing auxiliary data in the database up-to-date.
@@ -212,6 +212,11 @@ def recompute_importance(conn: Connection) -> None:
WHERE s.place_id = d.linked_place_id and d.wikipedia is not null
and (s.wikipedia is null or s.importance < d.importance);
""")
cur.execute("""
UPDATE search_name s SET importance = p.importance
FROM placex p
WHERE s.place_id = p.place_id AND s.importance != p.importance
""")
cur.execute('ALTER TABLE placex ENABLE TRIGGER ALL')
conn.commit()