X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/2af82975cd968ec09683ae5b16a9aa157a7f2176..57ce75eb67e292b2ddb7036619646ab73690ecfd:/nominatim/clicmd/transition.py diff --git a/nominatim/clicmd/transition.py b/nominatim/clicmd/transition.py index efce1fac..c9341f49 100644 --- a/nominatim/clicmd/transition.py +++ b/nominatim/clicmd/transition.py @@ -43,6 +43,8 @@ class AdminTransition: help='Index the data') group.add_argument('--create-search-indices', action='store_true', help='Create additional indices required for search and update') + group.add_argument('--create-country-names', action='store_true', + help='Create search index for default country names.') group = parser.add_argument_group('Options') group.add_argument('--no-partitions', action='store_true', help='Do not partition search indices') @@ -62,7 +64,7 @@ class AdminTransition: help='File to import') @staticmethod - def run(args): + def run(args): # pylint: disable=too-many-statements from ..tools import database_import, tiger_data from ..tools import refresh @@ -129,7 +131,7 @@ class AdminTransition: LOG.warning('Create Search indices') with connect(args.config.get_libpq_dsn()) as conn: database_import.create_search_indices(conn, args.config, args.sqllib_dir, args.drop) - + if args.tiger_data: LOG.warning('Tiger data') tiger_data.add_tiger_data(args.config.get_libpq_dsn(), @@ -137,3 +139,8 @@ class AdminTransition: args.threads or 1, args.config, args.sqllib_dir) + + if args.create_country_names: + LOG.warning('Create search index for default country names.') + with connect(args.config.get_libpq_dsn()) as conn: + database_import.create_country_names(conn, args.config)