]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/db_searches.py
reduce expected count for multi-part words
[nominatim.git] / nominatim / api / search / db_searches.py
index 4d89396288c90f67acdd3c6364ec414b4c59b9fa..1f7eb0093a6bc8245bbe3b422084e4bcd25d73fd 100644 (file)
@@ -271,7 +271,7 @@ class NearSearch(AbstractSearch):
         """
         table = await conn.get_class_table(*category)
 
         """
         table = await conn.get_class_table(*category)
 
-        t = conn.t.placex.alias('p')
+        t = conn.t.placex
         tgeom = conn.t.placex.alias('pgeom')
 
         sql = _select_placex(t).where(tgeom.c.place_id.in_(ids))\
         tgeom = conn.t.placex.alias('pgeom')
 
         sql = _select_placex(t).where(tgeom.c.place_id.in_(ids))\
@@ -685,7 +685,8 @@ class PlaceSearch(AbstractSearch):
             if self.qualifiers:
                 place_sql = place_sql.where(self.qualifiers.sql_restrict(thnr))
 
             if self.qualifiers:
                 place_sql = place_sql.where(self.qualifiers.sql_restrict(thnr))
 
-            numerals = [int(n) for n in self.housenumbers.values if n.isdigit()]
+            numerals = [int(n) for n in self.housenumbers.values
+                        if n.isdigit() and len(n) < 8]
             interpol_sql: SaColumn
             tiger_sql: SaColumn
             if numerals and \
             interpol_sql: SaColumn
             tiger_sql: SaColumn
             if numerals and \