From: Tareq Al-Ahdal Date: Thu, 17 Mar 2022 22:52:16 +0000 (+0800) Subject: modify logic of _include_key function X-Git-Tag: v4.1.0~64^2~14 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/af739d2f57854ba223c8c1f13c03954f56c49a5b?hp=fa2aca1cbc27a610b13372bed39bcbf349d71805 modify logic of _include_key function --- diff --git a/nominatim/tools/country_info.py b/nominatim/tools/country_info.py index 2457e01b..1ae53c28 100644 --- a/nominatim/tools/country_info.py +++ b/nominatim/tools/country_info.py @@ -111,9 +111,12 @@ def create_country_names(conn, tokenizer, languages=None): if languages: languages = languages.split(',') + # def _include_key(key): + # return key.startswith('name:') and \ + # key[5:] in languages or key[5:] == 'default' def _include_key(key): - return key.startswith('name:') and \ - key[5:] in languages or key[5:] == 'default' + return key == 'name' or \ + (key.startswith('name:') and (not languages or key[5:] in languages)) with conn.cursor() as cur: psycopg2.extras.register_hstore(cur)