minimum counts for tokens should always be 1

to avoid accidental devision by 0.
This commit is contained in:
Sarah Hoffmann
2024-04-01 14:25:51 +02:00
parent e53eb79923
commit 78c19bc006
2 changed files with 3 additions and 3 deletions

View File

@@ -209,7 +209,7 @@ class LegacyQueryAnalyzer(AbstractQueryAnalyzer):
is_indexed = False
return LegacyToken(penalty=penalty, token=row.word_id,
count=row.search_name_count or 1,
count=max(1, row.search_name_count or 1),
addr_count=1, # not supported
lookup_word=lookup_word,
word_token=row.word_token.strip(),