From af739d2f57854ba223c8c1f13c03954f56c49a5b Mon Sep 17 00:00:00 2001 From: Tareq Al-Ahdal Date: Fri, 18 Mar 2022 06:52:16 +0800 Subject: [PATCH 1/1] modify logic of _include_key function --- nominatim/tools/country_info.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.39.5