X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/96e5a23727acc29b007f94acfac8ef575d11072f..93f8e28eb146e671849b96f4d5ef1b924a907abc:/nominatim/api/search/db_searches.py diff --git a/nominatim/api/search/db_searches.py b/nominatim/api/search/db_searches.py index f4684044..115f32fa 100644 --- a/nominatim/api/search/db_searches.py +++ b/nominatim/api/search/db_searches.py @@ -427,6 +427,7 @@ class CountrySearch(AbstractSearch): result = nres.create_from_placex_row(row, nres.SearchResult) assert result result.accuracy = self.penalty + self.countries.get_penalty(row.country_code, 5.0) + result.bbox = Bbox.from_wkb(row.bbox) results.append(result) return results or await self.lookup_in_country_table(conn, details) @@ -638,7 +639,7 @@ class PlaceSearch(AbstractSearch): else: sql = sql.where(tsearch.c.centroid.ST_DWithin_no_index(NEAR_PARAM, NEAR_RADIUS_PARAM)) - sql = sql.add_columns(-tsearch.c.centroid.ST_Distance(NEAR_PARAM) + sql = sql.add_columns((-tsearch.c.centroid.ST_Distance(NEAR_PARAM)) .label('importance')) sql = sql.order_by(sa.desc(sa.text('importance'))) else: