+ 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;
+
+ -- Find all address tags that don't appear in the parent search names.
+ SELECT hstore(array_agg(ARRAY[k, v])) INTO filtered_address
+ FROM (SELECT skeys(address) as k, svals(address) as v) a
+ WHERE not addr_ids_from_name(v) && parent_address_vector
+ AND k not in ('country', 'street', 'place', 'postcode',
+ 'housenumber', 'streetnumber', 'conscriptionnumber');
+
+ -- Compute all search terms from the addr: tags.
+ IF filtered_address IS NOT NULL THEN
+ FOR addr_item IN
+ SELECT * FROM
+ get_places_for_addr_tags(in_partition, geometry, filtered_address, country)