From: Sarah Hoffmann Date: Wed, 4 Mar 2020 07:18:58 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~251 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6b52e3765c7de9fa4831470d5f079b37e45d92bf?hp=-c Merge remote-tracking branch 'upstream/master' --- 6b52e3765c7de9fa4831470d5f079b37e45d92bf diff --combined lib/Geocode.php index c1d0c46f,ab9446e0..0e5d4a53 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@@ -18,7 -18,7 +18,7 @@@ class Geocod protected $aLangPrefOrder = array(); protected $aExcludePlaceIDs = array(); - protected $bReverseInPlan = false; + protected $bReverseInPlan = true; protected $iLimit = 20; protected $iFinalLimit = 10; @@@ -808,9 -808,7 +808,7 @@@ $sSQL .= 'WHERE place_id in ('.$sPlaceIds.') '; $sSQL .= ' AND ('; $sSQL .= " placex.rank_address between $this->iMinAddressRank and $this->iMaxAddressRank "; - if (14 >= $this->iMinAddressRank && 14 <= $this->iMaxAddressRank) { - $sSQL .= " OR (extratags->'place') = 'city'"; - } + $sSQL .= " OR placex.rank_search between $this->iMinAddressRank and $this->iMaxAddressRank "; if ($this->aAddressRankList) { $sSQL .= ' OR placex.rank_address in ('.join(',', $this->aAddressRankList).')'; } diff --combined sql/functions/address_lookup.sql index 585c22c8,8436fdb1..dd096728 --- a/sql/functions/address_lookup.sql +++ b/sql/functions/address_lookup.sql @@@ -202,9 -202,10 +202,10 @@@ BEGI FOR location IN 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, + CASE WHEN extratags ? 'place' or extratags ? 'linked_place' + THEN 'place' ELSE class END as class, + coalesce(extratags->'place', extratags->'linked_place', type) as type, - admin_level, fromarea, isaddress, + admin_level, fromarea, isaddress and linked_place_id is NULL as isaddress, CASE 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)