-
- -- 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.
- name_vector := initial_name_vector;
- nameaddress_vector := array_merge(nameaddress_vector, parent_name_vector);
- nameaddress_vector := array_merge(nameaddress_vector, parent_address_vector);
-
- IF not address ? 'street' and address ? 'place' THEN
- -- make sure addr:place terms are always searchable
- nameaddress_vector := array_merge(nameaddress_vector,
- addr_ids_from_name(address->'place'));
- END IF;
-
- RETURN;
- END IF;
-
- ----- unnamed POIS
-
- IF (array_length(nameaddress_vector, 1) is null
- and (address ? 'street'or not address ? 'place'))
- or housenumber is null
- THEN
- RETURN;
- END IF;