]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/geocoder.py
disallow category tokens in the middle of a query string
[nominatim.git] / nominatim / api / search / geocoder.py
index 6b58c9457c16598ea8c735f8bcdb5d55a820febf..27e4d91ea6ae412a5b359bf06a65bdc165b8fdc1 100644 (file)
@@ -141,7 +141,8 @@ class ForwardGeocoder:
                or (result.importance is not None and result.importance < 0):
                 continue
             distance = 0.0
                or (result.importance is not None and result.importance < 0):
                 continue
             distance = 0.0
-            norm = self.query_analyzer.normalize_text(result.display_name)
+            norm = self.query_analyzer.normalize_text(' '.join((result.display_name,
+                                                                result.country_code or '')))
             words = set((w for w in norm.split(' ') if w))
             if not words:
                 continue
             words = set((w for w in norm.split(' ') if w))
             if not words:
                 continue