]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/db_search_builder.py
always add a penalty for name + address search fallback
[nominatim.git] / nominatim / api / search / db_search_builder.py
index 94c492c22be8c612f6e49379acde60419e8f9cef..62b4e1b51986b3a29becefee1078e969b5ad168f 100644 (file)
@@ -243,7 +243,8 @@ class SearchBuilder:
             lookup = [dbf.FieldLookup('name_vector', list(name_partials.keys()), lookups.LookupAll)]
             if addr_tokens:
                 lookup.append(dbf.FieldLookup('nameaddress_vector', addr_tokens, lookups.LookupAll))
-            penalty += 0.35 * max(0, 5 - len(name_partials) - len(addr_tokens))
+            penalty += 0.35 * max(1 if name_fulls else 0.1,
+                                  5 - len(name_partials) - len(addr_tokens))
             yield penalty, exp_count, lookup