split place search into address search and named search

The presence/absence of houenumbers makes quite a difference for search.
This commit is contained in:
Sarah Hoffmann
2025-07-07 09:01:44 +02:00
parent ab5f348a4a
commit 13eaea8aae
7 changed files with 646 additions and 433 deletions

View File

@@ -194,7 +194,10 @@ class SearchBuilder:
sdata.rankings.append(ranking)
for penalty, count, lookup in self.yield_lookups(name, address):
sdata.lookups = lookup
yield dbs.PlaceSearch(penalty + name_penalty, sdata, count)
if sdata.housenumbers:
yield dbs.AddressSearch(penalty + name_penalty, sdata, count)
else:
yield dbs.PlaceSearch(penalty + name_penalty, sdata, count)
def yield_lookups(self, name: qmod.TokenRange, address: List[qmod.TokenRange]
) -> Iterator[Tuple[float, int, List[dbf.FieldLookup]]]: