mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
do not lookup by address vector when only few tokens are available
Names of countries and states are exceedingly rare in the word count but are very frequent in the address. A short name has the danger of producing too many results.
This commit is contained in:
@@ -212,7 +212,7 @@ class SearchBuilder:
|
||||
|
||||
exp_count = min(exp_count, min(t.count for t in addr_partials)) \
|
||||
if addr_partials else exp_count
|
||||
if exp_count < 1000 and partials_indexed:
|
||||
if exp_count < 1000 and len(addr_tokens) > 3 and partials_indexed:
|
||||
# Lookup by address partials and restrict results through name terms.
|
||||
# Give this a small penalty because lookups in the address index are
|
||||
# more expensive
|
||||
|
||||
Reference in New Issue
Block a user