]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_api/search/db_search_builder.py
make housenumber search work with non-indexed partials
[nominatim.git] / src / nominatim_api / search / db_search_builder.py
index e29f0b931eb4f1b4758e9601d0d502d7bf4b531e..6453509ebce93d5ba26433742cb8263c87eb7045 100644 (file)
@@ -167,7 +167,12 @@ class SearchBuilder:
         expected_count = sum(t.count for t in hnrs)
 
         partials = {t.token: t.addr_count for trange in address
-                       for t in self.query.get_partials_list(trange)}
+                       for t in self.query.get_partials_list(trange)
+                       if t.is_indexed}
+
+        if not partials:
+            # can happen when none of the partials is indexed
+            return
 
         if expected_count < 8000:
             sdata.lookups.append(dbf.FieldLookup('nameaddress_vector',