]> git.openstreetmap.org Git - nominatim.git/commitdiff
remove restriction on frequent one word names
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 14:28:17 +0000 (16:28 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 2 Apr 2024 14:28:17 +0000 (16:28 +0200)
This is now solved by reducing results with the windowing SQL
during search.

nominatim/api/search/db_search_builder.py

index e27a24d61eb54f0d7bb1bc04abedc90703dacc8a..c2f98c4775621719faa359f72b8c36137613edee 100644 (file)
@@ -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)