]> git.openstreetmap.org Git - nominatim.git/commitdiff
fix postcode lookup with legacy tokenizer
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 31 Jul 2024 12:54:55 +0000 (14:54 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 31 Jul 2024 12:54:55 +0000 (14:54 +0200)
src/nominatim_api/search/legacy_tokenizer.py

index 68cbd712b46855e0161fff32189130e299739810..c7b101196be7523020ec4b5e002e950548d3d3db 100644 (file)
@@ -193,7 +193,7 @@ class LegacyQueryAnalyzer(AbstractQueryAnalyzer):
                 lookup_word = row.word_token[1:]
             elif rowclass == 'place' and  row.type == 'postcode':
                 ttype = qmod.TokenType.POSTCODE
                 lookup_word = row.word_token[1:]
             elif rowclass == 'place' and  row.type == 'postcode':
                 ttype = qmod.TokenType.POSTCODE
-                lookup_word = row.word_token[1:]
+                lookup_word = row.word
             else:
                 ttype = qmod.TokenType.NEAR_ITEM if row.operator in ('in', 'near')\
                         else qmod.TokenType.QUALIFIER
             else:
                 ttype = qmod.TokenType.NEAR_ITEM if row.operator in ('in', 'near')\
                         else qmod.TokenType.QUALIFIER