X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/fa2bc604685f4d9219844769b733d600d968deff..ffc2d82b0ed150d52a718dc563f9399062e579a7:/nominatim/indexer/indexer.py?ds=sidebyside diff --git a/nominatim/indexer/indexer.py b/nominatim/indexer/indexer.py index 2dd8220b..d0c6ea0c 100644 --- a/nominatim/indexer/indexer.py +++ b/nominatim/indexer/indexer.py @@ -4,6 +4,8 @@ Main work horse for indexing (computing addresses) the database. import logging import select +import psycopg2.extras + from nominatim.indexer.progress import ProgressLogger from nominatim.indexer import runners from nominatim.db.async_connection import DBConnection @@ -145,7 +147,7 @@ class Indexer: if maxrank == 30: self._index(runners.RankRunner(0, analyzer)) - self._index(runners.InterpolationRunner(), 20) + self._index(runners.InterpolationRunner(analyzer), 20) self._index(runners.RankRunner(30, analyzer), 20) else: self._index(runners.RankRunner(maxrank, analyzer)) @@ -176,6 +178,7 @@ class Indexer: LOG.warning("Starting %s (using batch size %s)", runner.name(), batch) with connect(self.dsn) as conn: + psycopg2.extras.register_hstore(conn) with conn.cursor() as cur: total_tuples = cur.scalar(runner.sql_count_objects()) LOG.debug("Total number of rows: %i", total_tuples) @@ -190,7 +193,7 @@ class Indexer: with WorkerPool(self.dsn, self.num_threads) as pool: while True: - places = [p for p in cur.fetchmany(batch)] + places = cur.fetchmany(batch) if not places: break