+
+
+ async def _do_index(self, args: NominatimArgs) -> None:
+ from ..tokenizer import factory as tokenizer_factory
+
+ tokenizer = tokenizer_factory.get_tokenizer_for_db(args.config)
+ from ..indexer.indexer import Indexer
+
+ indexer = Indexer(args.config.get_libpq_dsn(), tokenizer,
+ args.threads or psutil.cpu_count() or 1)
+
+ has_pending = True # run at least once
+ while has_pending:
+ if not args.no_boundaries:
+ await indexer.index_boundaries(args.minrank, args.maxrank)
+ if not args.boundaries_only:
+ await indexer.index_by_rank(args.minrank, args.maxrank)
+ await indexer.index_postcodes()
+ has_pending = indexer.has_pending()