]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/db_searches.py
avoid fallback country lookup when places are excluded
[nominatim.git] / nominatim / api / search / db_searches.py
index ba4a3995ac49bf344497b2fecdb84ad455793e2a..76ff368f85b177ae8ad9dee579ec0bbc6de4e160 100644 (file)
@@ -403,6 +403,12 @@ class CountrySearch(AbstractSearch):
                                       details: SearchDetails) -> nres.SearchResults:
         """ Look up the country in the fallback country tables.
         """
+        # Avoid the fallback search when this is a more search. Country results
+        # usually are in the first batch of results and it is not possible
+        # to exclude these fallbacks.
+        if details.excluded:
+            return nres.SearchResults()
+
         t = conn.t.country_name
         tgrid = conn.t.country_grid