X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/1c189060c2e0970ac61f55c48965b9a8308afc42..4a8b78985bc0b20b67204633a776a8eb60eba02c:/nominatim/api/search/db_search_fields.py?ds=inline diff --git a/nominatim/api/search/db_search_fields.py b/nominatim/api/search/db_search_fields.py index 2b2e3e56..612e9059 100644 --- a/nominatim/api/search/db_search_fields.py +++ b/nominatim/api/search/db_search_fields.py @@ -224,14 +224,15 @@ def lookup_by_names(name_tokens: List[int], addr_tokens: List[int]) -> List[Fiel return lookup -def lookup_by_any_name(name_tokens: List[int], addr_tokens: List[int]) -> List[FieldLookup]: +def lookup_by_any_name(name_tokens: List[int], addr_tokens: List[int], + lookup_type: str) -> List[FieldLookup]: """ Create a lookup list where name tokens are looked up via index and only one of the name tokens must be present. Potential address tokens are used to restrict the search further. """ lookup = [FieldLookup('name_vector', name_tokens, 'lookup_any')] if addr_tokens: - lookup.append(FieldLookup('nameaddress_vector', addr_tokens, 'restrict')) + lookup.append(FieldLookup('nameaddress_vector', addr_tokens, lookup_type)) return lookup