]> git.openstreetmap.org Git - nominatim.git/commitdiff
reduce expected count for multi-part words
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 11 Sep 2023 15:45:34 +0000 (17:45 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 11 Sep 2023 15:45:34 +0000 (17:45 +0200)
Fixes #3196.

nominatim/api/search/db_search_builder.py

index 03e78d45ed3d36ddd85048aef2aa9bfd437185c5..66e7efaf7f729dec8fdc8f0f889295b6ed8a6f67 100644 (file)
@@ -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)