mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-15 19:07:58 +00:00
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.
This commit is contained in:
@@ -121,6 +121,6 @@ class TokenTest extends \PHPUnit\Framework\TestCase
|
||||
$this->assertEquals(array(new Token\HouseNumber(999, '1051')), $TL->get('1051'));
|
||||
$this->assertEquals(array(new Token\Country(999, 'de')), $TL->get('alemagne'));
|
||||
$this->assertEquals(array(new Token\Postcode(999, '64286')), $TL->get('64286'));
|
||||
$this->assertEquals(array(new Token\Word(999, true, 533)), $TL->get('darmstadt'));
|
||||
$this->assertEquals(array(new Token\Word(999, true, 533, 0)), $TL->get('darmstadt'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user