]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-sql/tokenizer/icu_tokenizer.sql
fix a number of corner cases with interpolation splitting
[nominatim.git] / lib-sql / tokenizer / icu_tokenizer.sql
index f323334b88c5e4c65c38c998d1bbaac839bcec61..599d0eb089eaeff6b5be795734e3a9b139b97117 100644 (file)
@@ -97,10 +97,10 @@ AS $$
 $$ LANGUAGE SQL IMMUTABLE STRICT;
 
 
-CREATE OR REPLACE FUNCTION token_normalized_postcode(postcode TEXT)
+CREATE OR REPLACE FUNCTION token_get_postcode(info JSONB)
   RETURNS TEXT
 AS $$
-  SELECT CASE WHEN postcode SIMILAR TO '%(,|;)%' THEN NULL ELSE upper(trim(postcode))END;
+  SELECT info->>'postcode';
 $$ LANGUAGE SQL IMMUTABLE STRICT;