]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 29 Jan 2024 18:44:46 +0000 (19:44 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 29 Jan 2024 18:44:46 +0000 (19:44 +0100)
nominatim/api/search/db_search_builder.py

index 3d5796c526c18494242efa442c46813aa6b02b14..f2b653f2c2def3c3657abdc9159c3be66d215d5f 100644 (file)
@@ -176,11 +176,12 @@ class SearchBuilder:
             sdata.lookups.append(dbf.FieldLookup('nameaddress_vector',
                                                  list(partials), lookups.LookupAll))
         else:
+            addr_fulls = [t.token for t
+                          in self.query.get_tokens(address[0], TokenType.WORD)]
+            if len(addr_fulls) > 5:
+                return
             sdata.lookups.append(
-                dbf.FieldLookup('nameaddress_vector',
-                                [t.token for t
-                                 in self.query.get_tokens(address[0], TokenType.WORD)],
-                                lookups.LookupAny))
+                dbf.FieldLookup('nameaddress_vector', addr_fulls, lookups.LookupAny))
 
         sdata.housenumbers = dbf.WeightedStrings([], [])
         yield dbs.PlaceSearch(0.05, sdata, expected_count)