avoid splitting of first token when a housenumber is present

This only covers the case of <poi name> <street name> <housenumber>
which is exceedingly rare.
This commit is contained in:
Sarah Hoffmann
2023-07-14 21:05:13 +02:00
parent 8a36ed4f6f
commit 283db76e45
2 changed files with 8 additions and 4 deletions

View File

@@ -225,9 +225,7 @@ class SearchBuilder:
# This might yield wrong results, nothing we can do about that.
if not partials_indexed:
addr_tokens = [t.token for t in addr_partials if t.is_indexed]
log().var_dump('before', penalty)
penalty += 1.2 * sum(t.penalty for t in addr_partials if not t.is_indexed)
log().var_dump('after', penalty)
if rare_names:
# Any of the full names applies with all of the partials from the address
lookup = [dbf.FieldLookup('name_vector', [t.token for t in rare_names], 'lookup_any')]