X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a1bcb28ceaaa5d9b45cac80d5a7c82a4450fc0d4..626e3238f27d972614ad3c0e978605facf0f9bd2:/utils/update.php diff --git a/utils/update.php b/utils/update.php index 31c911cc..4317367a 100644 --- a/utils/update.php +++ b/utils/update.php @@ -322,13 +322,18 @@ if ($aResult['update-address-levels']) { } if ($aResult['recompute-importance']) { - echo 'Updating importance values for database.\n'; + echo "Updating importance values for database.\n"; $oDB = new Nominatim\DB(); $oDB->connect(); $sSQL = 'ALTER TABLE placex DISABLE TRIGGER ALL;'; - $sSQL .= 'UPDATE placex SET (wikipedia, importance) = (SELECT wikipedia, importance FROM compute_importance(extratags, country_code, osm_type, osm_id));'; - $sSQL .= 'UPDATE placex s SET wikipedia = d.wikipedia, importance = d.importance FROM placex d WHERE s.place_id = d.linked_place_id and d.wikipedia is not null and (s.wikipedia is null or s.importance < d.importance);'; + $sSQL .= 'UPDATE placex SET (wikipedia, importance) ='; + $sSQL .= ' (SELECT wikipedia, importance'; + $sSQL .= ' FROM compute_importance(extratags, country_code, osm_type, osm_id));'; + $sSQL .= 'UPDATE placex s SET wikipedia = d.wikipedia, importance = d.importance'; + $sSQL .= ' FROM placex d'; + $sSQL .= ' WHERE s.place_id = d.linked_place_id and d.wikipedia is not null'; + $sSQL .= ' and (s.wikipedia is null or s.importance < d.importance);'; $sSQL .= 'ALTER TABLE placex ENABLE TRIGGER ALL;'; $oDB->exec($sSQL); }