X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/85ab12c4716ce96f4d666fcc0bd59fa32d68874e..77f646410e09ab8cff9e039d5e1ef297f503a704:/sql/functions.sql diff --git a/sql/functions.sql b/sql/functions.sql index 777d20d0..3168b338 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1225,7 +1225,7 @@ DECLARE result BOOLEAN; BEGIN - IF NEW.indexed_status != 0 OR OLD.indexed_status = 0 THEN + IF NEW.indexed_status != 0 OR OLD.indexed_status = 0 OR NEW.linked_place_id is not null THEN RETURN NEW; END IF; @@ -1256,7 +1256,7 @@ BEGIN RETURN NEW; END IF; - IF OLD.indexed_status > 1 THEN + IF OLD.indexed_status > 0 THEN result := deleteSearchName(NEW.partition, NEW.place_id); DELETE FROM place_addressline WHERE place_id = NEW.place_id; DELETE FROM place_boundingbox where place_id = NEW.place_id; @@ -1630,7 +1630,7 @@ BEGIN location_rank_search := 100; location_distance := 0; -- RAISE WARNING ' getNearFeatures(%,''%'',%,''%'')',NEW.partition, place_centroid, search_maxrank, isin_tokens; - FOR location IN SELECT * from getNearFeatures(NEW.partition, place_centroid, search_maxrank, isin_tokens) LOOP + FOR location IN SELECT distinct * from getNearFeatures(NEW.partition, place_centroid, search_maxrank, isin_tokens) LOOP --RAISE WARNING ' AREA: %',location; @@ -1662,7 +1662,7 @@ BEGIN FOR i IN 1..array_upper(isin_tokens, 1) LOOP --RAISE WARNING ' getNearestNamedFeature: % % % %',NEW.partition, place_centroid, search_maxrank, isin_tokens[i]; - FOR location IN SELECT * from getNearestNamedFeature(NEW.partition, place_centroid, search_maxrank, isin_tokens[i]) LOOP + FOR location IN SELECT distinct * from getNearestNamedFeature(NEW.partition, place_centroid, search_maxrank, isin_tokens[i]) LOOP --RAISE WARNING ' ISIN: %',location;