From: Sarah Hoffmann Date: Mon, 28 Mar 2016 07:51:29 +0000 (+0200) Subject: make sure linked places get recomputed when unlinked X-Git-Tag: v3.0.0~188 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/23fa6018a449aa125b971d8c2155498b3e078c70?ds=sidebyside make sure linked places get recomputed when unlinked When linked the place may not be in the search index, so it must be reindexed when being unlinked. The status change will only have an effect during the subsequent update, so change tests to that effect. --- diff --git a/sql/functions.sql b/sql/functions.sql index 5ec98f20..b88a7f81 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1161,7 +1161,8 @@ BEGIN DELETE FROM place_addressline WHERE place_id = NEW.place_id; result := deleteRoad(NEW.partition, NEW.place_id); result := deleteLocationArea(NEW.partition, NEW.place_id, NEW.rank_search); - UPDATE placex set linked_place_id = null where linked_place_id = NEW.place_id; + UPDATE placex set linked_place_id = null, indexed_status = 2 + where linked_place_id = NEW.place_id; IF NEW.linked_place_id is not null THEN RETURN NEW; diff --git a/tests/features/db/update/linked_places.feature b/tests/features/db/update/linked_places.feature index 6f80f680..777a02f0 100644 --- a/tests/features/db/update/linked_places.feature +++ b/tests/features/db/update/linked_places.feature @@ -21,6 +21,8 @@ Feature: Updates of linked places Then table placex contains | object | linked_place_id | N1 | None + When updating place areas + | osm_type | osm_id | class | type | name | admin_level | geometry When sending query "foo" with dups Then results contain | osm_type @@ -42,6 +44,8 @@ Feature: Updates of linked places Then table placex contains | object | linked_place_id | N1 | None + When updating place areas + | osm_type | osm_id | class | type | name | admin_level | geometry And sending query "foo" with dups Then results contain | osm_type