X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/10a5424a71022a787902b86ddcefedb8688bb2b5..b427fc79656124cd91475ac26016f5865fbc04f3:/nominatim/api/search/icu_tokenizer.py diff --git a/nominatim/api/search/icu_tokenizer.py b/nominatim/api/search/icu_tokenizer.py index 72e0f547..1c2565d1 100644 --- a/nominatim/api/search/icu_tokenizer.py +++ b/nominatim/api/search/icu_tokenizer.py @@ -186,7 +186,10 @@ class ICUQueryAnalyzer(AbstractQueryAnalyzer): if trange.start == 0: query.add_token(trange, qmod.TokenType.NEAR_ITEM, token) else: - query.add_token(trange, qmod.TokenType.QUALIFIER, token) + if trange.start == 0 and trange.end == query.num_token_slots(): + query.add_token(trange, qmod.TokenType.NEAR_ITEM, token) + else: + query.add_token(trange, qmod.TokenType.QUALIFIER, token) else: query.add_token(trange, DB_TO_TOKEN_TYPE[row.type], token)