]> git.openstreetmap.org Git - nominatim.git/commitdiff
modify logic of _include_key function
authorTareq Al-Ahdal <tareqoalahdal@gmail.com>
Thu, 17 Mar 2022 22:52:16 +0000 (06:52 +0800)
committerTareq Al-Ahdal <tareqoalahdal@gmail.com>
Thu, 17 Mar 2022 22:52:16 +0000 (06:52 +0800)
nominatim/tools/country_info.py

index 2457e01b6b05178c7b7c41e55574953e8a4d9351..1ae53c28f86c3c41c3b539f8b543695adb7444c5 100644 (file)
@@ -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)