X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/21df87dedc032979e86e095a0deef7f02eaceb33..a8b023e57eda06bac3e5641f85f718e1d3104fe9:/nominatim/api/search/geocoder.py diff --git a/nominatim/api/search/geocoder.py b/nominatim/api/search/geocoder.py index 7ff3ed08..91c45b65 100644 --- a/nominatim/api/search/geocoder.py +++ b/nominatim/api/search/geocoder.py @@ -134,7 +134,10 @@ class ForwardGeocoder: return for result in results: - if not result.display_name: + # Negative importance indicates ordering by distance, which is + # more important than word matching. + if not result.display_name\ + or (result.importance is not None and result.importance < 0): continue distance = 0.0 norm = self.query_analyzer.normalize_text(result.display_name)