]> git.openstreetmap.org Git - nominatim.git/commit
improve handling of multi-word partials in SearchDescription
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Nov 2020 10:44:25 +0000 (11:44 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Nov 2020 11:07:04 +0000 (12:07 +0100)
commit0f87da017f83b321770044e52d7034894448dee6
tree40004769bf27086013692ec184ca7c76cb704d85
parentf21853ea9dcc50c468d0c92ba301fd2b4fd94325
improve handling of multi-word partials in SearchDescription

Multi-word partial terms had an undue advantage over separate partial
terms because they only need to pay the penalty once. This changes
the behaviour by setting the penalty according to the number of
words in the token. This should get rid of search interpretations
with low chance of matching.

This also fixes handling of exact term matching. We now match against
all exact terms of the query, not just a couple of them collected
while building the interpretations.

Also adds a penalty to very short postcodes.
lib/Geocode.php
lib/SearchContext.php
lib/SearchDescription.php
lib/TokenList.php
lib/TokenWord.php
test/php/Nominatim/TokenListTest.php