namespace Nominatim;
-require_once(CONST_BasePath.'/lib/SpecialSearchOperator.php');
-require_once(CONST_BasePath.'/lib/SearchContext.php');
-require_once(CONST_BasePath.'/lib/Result.php');
+require_once(CONST_LibDir.'/SpecialSearchOperator.php');
+require_once(CONST_LibDir.'/SearchContext.php');
+require_once(CONST_LibDir.'/Result.php');
/**
* Description of a single interpretation of a search query.
$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->bRareName = false;
+ $oSearch->aName = array($oSearchTerm->iId => $oSearchTerm->iId);
+ $aNewSearches[] = $oSearch;
+ }
}
} elseif ($sPhraseType == ''
&& is_a($oSearchTerm, '\Nominatim\Token\SpecialTerm')
) {
if ($oSearchTerm->iSearchNameCount < CONST_Max_Word_Frequency) {
$oSearch = clone $this;
- $oSearch->iSearchRank += $oSearchTerm->iTermCount;
+ $oSearch->iSearchRank += $oSearchTerm->iTermCount + 1;
if (empty($this->aName)) {
$oSearch->iSearchRank++;
}
$aNewSearches[] = $oSearch;
} else {
$oSearch = clone $this;
- $oSearch->iSearchRank++;
+ $oSearch->iSearchRank += $oSearchTerm->iTermCount + 1;
$oSearch->aAddressNonSearch[$iWordID] = $iWordID;
if (!empty($aFullTokens)) {
$oSearch->iSearchRank++;