mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 10:57:58 +00:00
Merge pull request #3979 from jayaddison/issue-2714-prep/extract-rank-zero-specialcasing
Indexer: relocate zero-ranked-address indexing
This commit is contained in:
@@ -56,7 +56,7 @@ class Indexer:
|
||||
cur.execute('ANALYZE')
|
||||
|
||||
while True:
|
||||
if await self.index_by_rank(0, 4) > 0:
|
||||
if await self.index_by_rank(1, 4) > 0:
|
||||
_analyze()
|
||||
|
||||
if await self.index_boundaries() > 100:
|
||||
@@ -68,6 +68,9 @@ class Indexer:
|
||||
if await self.index_by_rank(26, 30) > 1000:
|
||||
_analyze()
|
||||
|
||||
# Special case: rank zero depends on the previously-indexed [1..30] ranks
|
||||
await self.index_by_rank(0, 0)
|
||||
|
||||
if await self.index_postcodes() > 100:
|
||||
_analyze()
|
||||
|
||||
@@ -147,8 +150,11 @@ class Indexer:
|
||||
total += await self._index(runners.RankRunner(rank, analyzer),
|
||||
batch=batch, total_tuples=total_tuples.get(rank, 0))
|
||||
|
||||
if maxrank == 30:
|
||||
# Special case: rank zero depends on ranks [1..30]
|
||||
if minrank == 0:
|
||||
total += await self._index(runners.RankRunner(0, analyzer))
|
||||
|
||||
if maxrank == 30:
|
||||
total += await self._index(runners.InterpolationRunner(analyzer), batch=20)
|
||||
|
||||
return total
|
||||
|
||||
Reference in New Issue
Block a user