mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-27 10:43:02 +03:00
parent
f8d55b5448
commit
0d2cdb5c2f
@ -748,11 +748,11 @@ class Geocode
|
|||||||
}
|
}
|
||||||
} elseif (($sPhraseType == '' || $sPhraseType == 'postalcode') && $aSearchTerm['class'] == 'place' && $aSearchTerm['type'] == 'postcode') {
|
} elseif (($sPhraseType == '' || $sPhraseType == 'postalcode') && $aSearchTerm['class'] == 'place' && $aSearchTerm['type'] == 'postcode') {
|
||||||
// We need to try the case where the postal code is the primary element (i.e. no way to tell if it is (postalcode, city) OR (city, postalcode) so try both
|
// We need to try the case where the postal code is the primary element (i.e. no way to tell if it is (postalcode, city) OR (city, postalcode) so try both
|
||||||
if (!$bHavePostcode && $aSearch['sPostcode'] === '' && $aSearch['sHouseNumber'] === '' &&
|
if ($aSearch['sPostcode'] === '' &&
|
||||||
isset($aSearchTerm['word']) && $aSearchTerm['word'] && strpos($sNormQuery, $this->normTerm($aSearchTerm['word'])) !== false) {
|
isset($aSearchTerm['word']) && $aSearchTerm['word'] && strpos($sNormQuery, $this->normTerm($aSearchTerm['word'])) !== false) {
|
||||||
// If we have structured search or this is the first term,
|
// If we have structured search or this is the first term,
|
||||||
// make the postcode the primary search element.
|
// make the postcode the primary search element.
|
||||||
if ($aSearch['sOperator'] === '' && ($sPhraseType == 'postalcode' || ($iToken == 0 && $iPhrase == 0))) {
|
if (!$bHavePostcode && $aSearch['sOperator'] === '' && ($sPhraseType == 'postalcode' || ($iToken == 0 && $iPhrase == 0))) {
|
||||||
$aNewSearch = $aSearch;
|
$aNewSearch = $aSearch;
|
||||||
$aNewSearch['sOperator'] = 'postcode';
|
$aNewSearch['sOperator'] = 'postcode';
|
||||||
$aNewSearch['aAddress'] = array_merge($aNewSearch['aAddress'], $aNewSearch['aName']);
|
$aNewSearch['aAddress'] = array_merge($aNewSearch['aAddress'], $aNewSearch['aName']);
|
||||||
|
Loading…
Reference in New Issue
Block a user