From: Sarah Hoffmann Date: Sun, 19 Aug 2012 21:08:51 +0000 (+0200) Subject: make sure first of each address rank is used X-Git-Tag: v2.0.0~35 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/8e004dca446088ee06a65f0e18e277209eae7bb3 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 --- diff --git a/sql/functions.sql b/sql/functions.sql index 548362ad..382cb003 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -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;