make sure first of each address rank is used

get_addressdata should not really return duplicates but if there are
the first result will be the best one, so make sure that one is used
This commit is contained in:
Sarah Hoffmann 2012-08-19 23:08:51 +02:00
parent 55b59ea139
commit 8e004dca44

View File

@ -2178,7 +2178,7 @@ BEGIN
FOR location IN select * from get_addressdata(for_place_id) where isaddress order by rank_address desc LOOP
currresult := trim(get_name_by_language(location.name, languagepref));
IF currresult != prevresult AND currresult IS NOT NULL THEN
IF currresult != prevresult AND currresult IS NOT NULL AND result[(100 - location.rank_address)] IS NULL THEN
result[(100 - location.rank_address)] := trim(get_name_by_language(location.name, languagepref));
prevresult := currresult;
END IF;