Merge pull request #2074 from lonvia/add-housenumber-to-unknown-places

Improve finding addresses that have their own search_name entry because of unknown addr:* parts
This commit is contained in:
Sarah Hoffmann
2020-11-25 16:57:09 +01:00
committed by GitHub
5 changed files with 135 additions and 45 deletions

View File

@@ -248,6 +248,18 @@ class SearchDescription
$oSearch->iSearchRank++;
}
$aNewSearches[] = $oSearch;
// Housenumbers may appear in the name when the place has its own
// address terms.
if ($oSearchTerm->iId !== null
&& ($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')