From 0a8e8cec0f6112e1ea0a339560b6bbf5da0a820c Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Sun, 13 Aug 2023 11:59:01 +0200 Subject: [PATCH] fix application of label to wrong expression --- nominatim/api/search/db_searches.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nominatim/api/search/db_searches.py b/nominatim/api/search/db_searches.py index f4684044..638f5b83 100644 --- a/nominatim/api/search/db_searches.py +++ b/nominatim/api/search/db_searches.py @@ -638,7 +638,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: -- 2.39.5