interpret stand-alone special terms always as near term

Fixes #3298.
This commit is contained in:
Sarah Hoffmann
2024-01-16 17:19:21 +01:00
parent b969c5a62f
commit e0ca2ce6ec
3 changed files with 26 additions and 1 deletions

View File

@@ -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)