+ IF searchcountrycode IS NOT NULL THEN
+ location := ROW(null, null, null, 'ref'=>searchcountrycode, 'place', 'country_code', true, false, 4, 0)::addressline;
+ RETURN NEXT location;
+ END IF;
+
+ IF searchhousename IS NOT NULL THEN
+ location := ROW(in_place_id, null, null, searchhousename, 'place', 'house_name', true, true, 29, 0)::addressline;
+ RETURN NEXT location;
+ END IF;
+
+ IF searchhousenumber IS NOT NULL THEN
+ location := ROW(in_place_id, null, null, 'ref'=>searchhousenumber, 'place', 'house_number', true, true, 28, 0)::addressline;
+ RETURN NEXT location;
+ END IF;
+
+ IF searchpostcode IS NOT NULL THEN
+ location := ROW(null, null, null, 'ref'=>searchpostcode, 'place', 'postcode', true, true, 5, 0)::addressline;
+ RETURN NEXT location;
+ END IF;
+
+ RETURN;