skip is_in items already in address vector

This commit is contained in:
Sarah Hoffmann 2012-09-29 18:02:32 +02:00
parent 3337515052
commit 199308ca5e

View File

@ -1699,10 +1699,11 @@ BEGIN
IF array_upper(isin_tokens, 1) IS NOT NULL THEN
FOR i IN 1..array_upper(isin_tokens, 1) LOOP
--RAISE WARNING ' getNearestNamedFeature: % % % %',NEW.partition, place_centroid, search_maxrank, isin_tokens[i];
IF NOT ARRAY[isin_tokens[i]] <@ nameaddress_vector THEN
FOR location IN SELECT * from getNearestNamedFeature(NEW.partition, place_centroid, search_maxrank, isin_tokens[i]) LOOP
--RAISE WARNING ' ISIN: %',location;
--RAISE WARNING ' ISIN: %',location;
nameaddress_vector := array_merge(nameaddress_vector, location.keywords::integer[]);
INSERT INTO place_addressline VALUES (NEW.place_id, location.place_id, false, NOT address_havelevel[location.rank_address], location.distance, location.rank_address);
@ -1715,6 +1716,8 @@ BEGIN
END LOOP;
END IF;
END LOOP;
END IF;