X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/06aab389ede19c9d2a63630ddf0bae3bdc173f63..8b8dfc46ebee5f78a91685dc83dc9382d21aad0e:/nominatim/tokenizer/legacy_tokenizer.py diff --git a/nominatim/tokenizer/legacy_tokenizer.py b/nominatim/tokenizer/legacy_tokenizer.py index 438a5aff..5bd45c51 100644 --- a/nominatim/tokenizer/legacy_tokenizer.py +++ b/nominatim/tokenizer/legacy_tokenizer.py @@ -314,7 +314,7 @@ class LegacyNameAnalyzer: FROM location_postcode) x""") - def update_special_phrases(self, phrases): + def update_special_phrases(self, phrases, should_replace): """ Replace the search index for special phrases with the new phrases. """ norm_phrases = set(((self.normalize(p[0]), p[1], p[2], p[3]) @@ -343,7 +343,7 @@ class LegacyNameAnalyzer: FROM (VALUES %s) as v(name, class, type, op))""", to_add) - if to_delete: + if to_delete and should_replace: psycopg2.extras.execute_values( cur, """ DELETE FROM word USING (VALUES %s) as v(name, in_class, in_type, op)