X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b00d16fd7d41b41eb41128fdc4866dd3d7a67a95..503baf46d58e414eca0ec19cdafd2229b372485f:/sql/partition-functions.src.sql diff --git a/sql/partition-functions.src.sql b/sql/partition-functions.src.sql index 8f78032e..34b4d390 100644 --- a/sql/partition-functions.src.sql +++ b/sql/partition-functions.src.sql @@ -20,7 +20,8 @@ BEGIN FOR r IN SELECT place_id, keywords, rank_address, rank_search, min(ST_Distance(feature, centroid)) as distance, isguess, postcode, centroid FROM location_area_large_-partition- - WHERE ST_Intersects(geometry, feature) and rank_search < maxrank + WHERE ST_Intersects(geometry, feature) + AND rank_search < maxrank AND rank_address < maxrank GROUP BY place_id, keywords, rank_address, rank_search, isguess, postcode, centroid ORDER BY rank_address, isin_tokens && keywords desc, isguess asc, ST_Distance(feature, centroid) *