]> git.openstreetmap.org Git - nominatim.git/blobdiff - nominatim/api/search/icu_tokenizer.py
Merge pull request #3383 from lonvia/window-searches
[nominatim.git] / nominatim / api / search / icu_tokenizer.py
index 05ec7690c8ac0a34d8436fd08e641f4cb19bd680..eb90c122eb43277a18b2d71bf48eb9ab99a375ac 100644 (file)
@@ -122,10 +122,10 @@ class ICUToken(qmod.Token):
         else:
             lookup_word = row.word_token
 
-        return ICUToken(penalty=penalty, token=row.word_id, count=count,
+        return ICUToken(penalty=penalty, token=row.word_id, count=max(1, count),
                         lookup_word=lookup_word, is_indexed=True,
                         word_token=row.word_token, info=row.info,
-                        addr_count=addr_count)
+                        addr_count=max(1, addr_count))