From: Sarah Hoffmann Date: Mon, 11 Sep 2023 15:45:34 +0000 (+0200) Subject: reduce expected count for multi-part words X-Git-Tag: v4.4.0~98^2~1 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/44da684d1dfc57c085f6544d615374e97d8e96db?ds=inline reduce expected count for multi-part words Fixes #3196. --- diff --git a/nominatim/api/search/db_search_builder.py b/nominatim/api/search/db_search_builder.py index 03e78d45..66e7efaf 100644 --- a/nominatim/api/search/db_search_builder.py +++ b/nominatim/api/search/db_search_builder.py @@ -206,7 +206,7 @@ class SearchBuilder: partials_indexed = all(t.is_indexed for t in name_partials) \ and all(t.is_indexed for t in addr_partials) - exp_count = min(t.count for t in name_partials) + exp_count = min(t.count for t in name_partials) / (2**(len(name_partials) - 1)) if (len(name_partials) > 3 or exp_count < 3000) and partials_indexed: yield penalty, exp_count, dbf.lookup_by_names(name_tokens, addr_tokens)