- IF address IS NOT NULL THEN
- FOR addr_item IN SELECT * FROM each(address)
- LOOP
- IF addr_item.key IN ('city', 'tiger:county', 'state', 'suburb', 'province',
- 'district', 'region', 'county', 'municipality',
- 'hamlet', 'village', 'subdistrict', 'town',
- 'neighbourhood', 'quarter', 'parish')
- THEN
- nameaddress_vector := array_merge(nameaddress_vector,
- addr_ids_from_name(addr_item.value));
- END IF;
- END LOOP;
- END IF;
-
- -- If the POI is named, simply mix in all address terms and be done.
- IF array_length(initial_name_vector, 1) is not NULL THEN
- -- Cheating here by not recomputing all terms but simply using the ones
- -- from the parent object.
- SELECT array_merge(s.name_vector, s.nameaddress_vector)
- INTO parent_address_vector
- FROM search_name s
- WHERE s.place_id = parent_place_id;
+ SELECT s.name_vector, s.nameaddress_vector
+ INTO parent_name_vector, parent_address_vector
+ FROM search_name s
+ WHERE s.place_id = parent_place_id;