X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9d103503f71eef5dc6c5f85f5b84b11410f52cdb..b4fe7d7c7df335ce62eb8ec626428b45b38235a6:/lib-sql/functions/address_lookup.sql?ds=sidebyside

diff --git a/lib-sql/functions/address_lookup.sql b/lib-sql/functions/address_lookup.sql
index f49bc93e..5ec977d1 100644
--- a/lib-sql/functions/address_lookup.sql
+++ b/lib-sql/functions/address_lookup.sql
@@ -164,7 +164,10 @@ BEGIN
   -- POI objects in the placex table
   IF place IS NULL THEN
     SELECT parent_place_id as place_id, country_code,
-           housenumber, postcode,
+           coalesce(address->'housenumber',
+                    address->'streetnumber',
+                    address->'conscriptionnumber')::text as housenumber,
+           postcode,
            class, type,
            name, address,
            centroid
@@ -178,7 +181,7 @@ BEGIN
   -- place we should be using instead.
   IF place IS NULL THEN
     select coalesce(linked_place_id, place_id) as place_id,  country_code,
-           housenumber, postcode,
+           null::text as housenumber, postcode,
            class, type,
            null as name, address,
            null as centroid
