fix application of label to wrong expression

This commit is contained in:
Sarah Hoffmann 2023-08-13 11:59:01 +02:00
parent 96e5a23727
commit 0a8e8cec0f

View File

@ -638,7 +638,7 @@ class PlaceSearch(AbstractSearch):
else: else:
sql = sql.where(tsearch.c.centroid.ST_DWithin_no_index(NEAR_PARAM, sql = sql.where(tsearch.c.centroid.ST_DWithin_no_index(NEAR_PARAM,
NEAR_RADIUS_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')) .label('importance'))
sql = sql.order_by(sa.desc(sa.text('importance'))) sql = sql.order_by(sa.desc(sa.text('importance')))
else: else: