From: Sarah Hoffmann Date: Fri, 24 Jun 2022 19:15:34 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~103 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/6dbec931f58c659075a903db1e8eab15b1c93b03?hp=-c Merge remote-tracking branch 'upstream/master' --- 6dbec931f58c659075a903db1e8eab15b1c93b03 diff --combined lib-sql/functions/address_lookup.sql index 7fb11cfb,2bbfcd5c..312aa9b2 --- a/lib-sql/functions/address_lookup.sql +++ b/lib-sql/functions/address_lookup.sql @@@ -231,7 -231,7 +231,7 @@@ BEGI FOR location IN SELECT placex.place_id, osm_type, osm_id, name, class, type, coalesce(extratags->'linked_place', extratags->'place') as place_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) @@@ -320,6 -320,11 +320,11 @@@ location := ROW(null, null, null, hstore('ref', place.postcode), 'place', 'postcode', null, null, false, true, 5, 0)::addressline; RETURN NEXT location; + ELSEIF place.address is not null and place.address ? 'postcode' + and not place.address->'postcode' SIMILAR TO '%(,|;)%' THEN + location := ROW(null, null, null, hstore('ref', place.address->'postcode'), 'place', + 'postcode', null, null, false, true, 5, 0)::addressline; + RETURN NEXT location; END IF; RETURN;