]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix application of label to wrong expression
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 13 Aug 2023 09:59:01 +0000 (11:59 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 13 Aug 2023 09:59:01 +0000 (11:59 +0200)
nominatim/api/search/db_searches.py

index f4684044c6fac08fffa05b6e205ffdd70c1020bd..638f5b834900fc5d8d0d702b31b7832b010414c9 100644 (file)
@@ -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: