]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Apr 2024 13:05:36 +0000 (15:05 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Apr 2024 13:05:36 +0000 (15:05 +0200)
nominatim/api/search/icu_tokenizer.py
nominatim/api/search/legacy_tokenizer.py
settings/taginfo.lua

index 23cfa5a166c003a1b5638f0334d10636a335d935..f6590f5b36f87f0ac81f80dd5c1ef7a12fb8a726 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))
 
 
 
index bd17706e5dff7c3fc5fd5f1d37eafe234fd809f1..031f2456c455d108c21e1ea14a048b9f6d396df2 100644 (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(),
index dba395e9b3e3ee9a2fae9badeee40f930c109a61..ef2ad2a60a1094aeee62e3436db6ad0d5de66511 100644 (file)
@@ -35,7 +35,7 @@ function print_taginfo()
     for _, k in ipairs(flex.TAGINFO_MAIN.keys) do
         local desc = get_key_description(k, 'POI/feature in the search database')
         if flex.TAGINFO_MAIN.delete_tags[k] ~= nil then
-            desc.description = string.format('%s(except for values: %s).', desc.description,
+            desc.description = string.format('%s (except for values: %s).', desc.description,
                                 table.concat(flex.TAGINFO_MAIN.delete_tags[k], ', '))
         end
         table.insert(tags, desc)