forked from hans/Nominatim
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:
@@ -32,7 +32,18 @@ class SearchContext
|
||||
public $sqlCountryList = '';
|
||||
/// List of place IDs to exclude (as SQL).
|
||||
private $sqlExcludeList = '';
|
||||
/// Subset of word ids of full words in the query.
|
||||
private $aFullNameWords = array();
|
||||
|
||||
public function setFullNameWords($aWordList)
|
||||
{
|
||||
$this->aFullNameWords = $aWordList;
|
||||
}
|
||||
|
||||
public function getFullNameTerms()
|
||||
{
|
||||
return $this->aFullNameWords;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a reference point is defined.
|
||||
|
||||
Reference in New Issue
Block a user