From: Sarah Hoffmann Date: Sun, 17 Dec 2017 22:51:43 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~350 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/2110207074f4b67b1cea1b4c322201664395a843?hp=-c Merge remote-tracking branch 'upstream/master' --- 2110207074f4b67b1cea1b4c322201664395a843 diff --combined sql/functions.sql index e5e189a8,58d3fc7d..70580408 --- a/sql/functions.sql +++ b/sql/functions.sql @@@ -1355,7 -1355,7 +1355,7 @@@ BEGI --DEBUG: RAISE WARNING 'waterway parent %, child %/%', NEW.osm_id, i, relation_members[i]; FOR linked_node_id IN SELECT place_id FROM placex WHERE osm_type = 'W' and osm_id = substring(relation_members[i],2,200)::bigint - and class = NEW.class and type = NEW.type + and class = NEW.class and type in ('river', 'stream', 'canal', 'drain', 'ditch') and ( relation_members[i+1] != 'side_stream' or NEW.name->'name' = name->'name') LOOP UPDATE placex SET linked_place_id = NEW.place_id WHERE place_id = linked_node_id; @@@ -2503,7 -2503,7 +2503,7 @@@ BEGI select placex.place_id, osm_type, osm_id, name, CASE WHEN extratags ? 'place' THEN 'place' ELSE class END as class, CASE WHEN extratags ? 'place' THEN extratags->'place' ELSE type END as type, - admin_level, fromarea, isaddress, + admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress, CASE WHEN address_place_id = for_place_id AND rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address, distance,country_code,postcode from place_addressline join placex on (address_place_id = placex.place_id) diff --combined utils/update.php index 006a4774,c5b5e4de..bb77e430 --- a/utils/update.php +++ b/utils/update.php @@@ -33,12 -33,12 +33,13 @@@ $aCMDOption array('index-instances', '', 0, 1, 1, 1, 'int', 'Number of indexing instances (threads)'), array('deduplicate', '', 0, 1, 0, 0, 'bool', 'Deduplicate tokens'), + array('recompute-word-counts', '', 0, 1, 0, 0, 'bool', 'Compute frequency of full-word search terms'), array('no-npi', '', 0, 1, 0, 0, 'bool', '(obsolete)'), ); getCmdOpt($_SERVER['argv'], $aCMDOptions, $aResult, true, true); if (!isset($aResult['index-instances'])) $aResult['index-instances'] = 1; + if (!isset($aResult['index-rank'])) $aResult['index-rank'] = 0; date_default_timezone_set('Etc/UTC'); @@@ -238,6 -238,12 +239,12 @@@ if ($aResult['deduplicate']) } } + if ($aResult['recompute-word-counts']) { + info('Recompute frequency of full-word search terms'); + $sTemplate = file_get_contents(CONST_BasePath.'/sql/words_from_search_name.sql'); + runSQLScript($sTemplate, true, true); + } + if ($aResult['index']) { passthru(CONST_InstallPath.'/nominatim/nominatim -i -d '.$aDSNInfo['database'].' -P '.$aDSNInfo['port'].' -t '.$aResult['index-instances'].' -r '.$aResult['index-rank']); }