- FOR r IN
- SELECT place_id, name_vector, address_rank, search_rank,
- ST_Distance(centroid, point) as distance, null as isguess
- FROM search_name_-partition-
- WHERE name_vector @> ARRAY[isin_token]
- AND search_rank < maxrank
- UNION ALL
- SELECT place_id, name_vector, address_rank, search_rank,
- ST_Distance(centroid, point) as distance, null as isguess
- FROM search_name_country
- WHERE name_vector @> ARRAY[isin_token]
- AND search_rank < maxrank
- ORDER BY distance ASC limit 1
- LOOP
- RETURN NEXT r;
- END LOOP;
- RETURN;
+ INSERT INTO location_area_large_-partition- (partition, place_id, country_code, keywords, rank_search, rank_address, isguess, postcode, centroid, geometry)
+ values (in_partition, in_place_id, in_country_code, in_keywords, in_rank_search, in_rank_address, in_estimate, postcode, in_centroid, in_geometry);
+ RETURN TRUE;