mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-16 15:47:58 +00:00
Search housenumbers with unknown address parts by housenumber term
House numbers need special handling because they may appear after the street term. That means we canot just use them as the main name for searches where the address has its own search term entries. Doing this right now, we are able to find '40, Main St, Town' but not 'Main St 40, Town'. This switches to using the housenumber token as the name term instead. House number tokens can get special handling when building the search query that covers the case where they come after the street. The main disadvantage is that this once more increases the numbers of possible search interpretation of which we have already too many. no penalty for housenumber searches
This commit is contained in:
@@ -247,6 +247,15 @@ class SearchDescription
|
||||
$oSearch->iSearchRank++;
|
||||
}
|
||||
$aNewSearches[] = $oSearch;
|
||||
// Housenumbers may appear in the name when the place has its own
|
||||
// address terms.
|
||||
if (($this->iNamePhrase >= 0 || empty($this->aName)) && empty($this->aAddress)) {
|
||||
$oSearch = clone $this;
|
||||
$oSearch->iSearchRank++;
|
||||
$oSearch->aAddress = $this->aName;
|
||||
$oSearch->aName = array($oSearchTerm->iId => $oSearchTerm->iId);
|
||||
$aNewSearches[] = $oSearch;
|
||||
}
|
||||
}
|
||||
} elseif ($sPhraseType == ''
|
||||
&& is_a($oSearchTerm, '\Nominatim\Token\SpecialTerm')
|
||||
|
||||
Reference in New Issue
Block a user