]> git.openstreetmap.org Git - nominatim.git/blobdiff - src/nominatim_api/search/geocoder.py
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / src / nominatim_api / search / geocoder.py
index 195dd513ebc103b462d85bed236b4dccde858f72..efe5b7216853ba64c4983cd31801999c750c1512 100644 (file)
@@ -116,7 +116,7 @@ class ForwardGeocoder:
             limit to the configured number of results.
         """
         if results:
-            results.sort(key=lambda r: r.ranking)
+            results.sort(key=lambda r: (r.ranking, 0 if r.bbox is None else -r.bbox.area))
             min_rank = results[0].rank_search
             min_ranking = results[0].ranking
             results = SearchResults(r for r in results