From 28f7e51279e8ffa7eba2d1e3ff6541940eb0e6f5 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 8 Jan 2024 12:23:23 +0100 Subject: [PATCH] add country code to words to be rematched --- nominatim/api/search/geocoder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nominatim/api/search/geocoder.py b/nominatim/api/search/geocoder.py index 6b58c9457..27e4d91ea 100644 --- a/nominatim/api/search/geocoder.py +++ b/nominatim/api/search/geocoder.py @@ -141,7 +141,8 @@ def rerank_by_query(self, query: QueryStruct, results: SearchResults) -> None: 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