From ba1fc5a5b8c040b4eefc54641d7aeda09c1bccd5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Wed, 7 Jan 2026 11:27:55 +0100 Subject: [PATCH] do not insert entries with empty name into search name --- lib-sql/functions/placex_triggers.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib-sql/functions/placex_triggers.sql b/lib-sql/functions/placex_triggers.sql index 8c4ae6a6..5f52d274 100644 --- a/lib-sql/functions/placex_triggers.sql +++ b/lib-sql/functions/placex_triggers.sql @@ -465,7 +465,7 @@ BEGIN END IF; END LOOP; - name_vector := token_get_name_search_tokens(token_info); + name_vector := COALESCE(token_get_name_search_tokens(token_info), '{}'::INTEGER[]); -- Check if the parent covers all address terms. -- If not, create a search name entry with the house number as the name. @@ -1279,10 +1279,10 @@ BEGIN NEW.postcode := coalesce(token_get_postcode(NEW.token_info), NEW.postcode); -- if we have a name add this to the name search table - IF NEW.name IS NOT NULL THEN + name_vector := token_get_name_search_tokens(NEW.token_info); + IF array_length(name_vector, 1) is not NULL THEN -- Initialise the name vector using our name NEW.name := add_default_place_name(NEW.country_code, NEW.name); - name_vector := token_get_name_search_tokens(NEW.token_info); IF NEW.rank_search <= 25 and NEW.rank_address > 0 THEN result := add_location(NEW.place_id, NEW.country_code, NEW.partition, -- 2.39.5