From: Sarah Hoffmann Date: Tue, 2 Apr 2024 14:28:17 +0000 (+0200) Subject: remove restriction on frequent one word names X-Git-Tag: deploy~3^2^2~3 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/9f42c3f3b8333a5f65bbe34f5a5a4e0a350d84c3 remove restriction on frequent one word names This is now solved by reducing results with the windowing SQL during search. --- diff --git a/nominatim/api/search/db_search_builder.py b/nominatim/api/search/db_search_builder.py index e27a24d6..c2f98c47 100644 --- a/nominatim/api/search/db_search_builder.py +++ b/nominatim/api/search/db_search_builder.py @@ -227,8 +227,6 @@ class SearchBuilder: name_fulls = self.query.get_tokens(name, TokenType.WORD) if name_fulls: fulls_count = sum(t.count for t in name_fulls) - if len(name_partials) == 1: - penalty += min(0.5, max(0, (exp_count - 50 * fulls_count) / (2000 * fulls_count))) if partials_indexed: penalty += 1.2 * sum(t.penalty for t in addr_partials if not t.is_indexed)