mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
Refactor: add default params to index_boundaries
This commit is contained in:
@@ -59,7 +59,7 @@ class Indexer:
|
||||
if await self.index_by_rank(0, 4) > 0:
|
||||
_analyze()
|
||||
|
||||
if await self.index_boundaries(0, 30) > 100:
|
||||
if await self.index_boundaries() > 100:
|
||||
_analyze()
|
||||
|
||||
if await self.index_by_rank(5, 25) > 100:
|
||||
@@ -74,7 +74,7 @@ class Indexer:
|
||||
if not self.has_pending():
|
||||
break
|
||||
|
||||
async def index_boundaries(self, minrank: int, maxrank: int) -> int:
|
||||
async def index_boundaries(self, minrank: int = 0, maxrank: int = 30) -> int:
|
||||
""" Index only administrative boundaries within the given rank range.
|
||||
"""
|
||||
total = 0
|
||||
|
||||
@@ -247,7 +247,7 @@ async def test_index_boundaries(test_db, threads, test_tokenizer):
|
||||
assert test_db.osmline_unindexed() == 1
|
||||
|
||||
idx = indexer.Indexer('dbname=test_nominatim_python_unittest', test_tokenizer, threads)
|
||||
await idx.index_boundaries(0, 30)
|
||||
await idx.index_boundaries()
|
||||
|
||||
assert test_db.placex_unindexed() == 31
|
||||
assert test_db.osmline_unindexed() == 1
|
||||
|
||||
Reference in New Issue
Block a user