mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
allow country name at beginning for reverse order
This commit is contained in:
@@ -533,7 +533,12 @@
|
|||||||
{
|
{
|
||||||
$aSearch['sCountryCode'] = strtolower($aSearchTerm['country_code']);
|
$aSearch['sCountryCode'] = strtolower($aSearchTerm['country_code']);
|
||||||
// Country is almost always at the end of the string - increase score for finding it anywhere else (optimisation)
|
// Country is almost always at the end of the string - increase score for finding it anywhere else (optimisation)
|
||||||
if ($iToken+1 != sizeof($aWordset) || $iPhrase+1 != sizeof($aPhrases)) $aSearch['iSearchRank'] += 5;
|
// If reverse order is enabled, it may appear at the beginning as well.
|
||||||
|
if (($iToken+1 != sizeof($aWordset) || $iPhrase+1 != sizeof($aPhrases)) &&
|
||||||
|
(!$bReverseInPlan || $iToken > 0 || $iPhrase > 0))
|
||||||
|
{
|
||||||
|
$aSearch['iSearchRank'] += 5;
|
||||||
|
}
|
||||||
if ($aSearch['iSearchRank'] < $iMaxRank) $aNewWordsetSearches[] = $aSearch;
|
if ($aSearch['iSearchRank'] < $iMaxRank) $aNewWordsetSearches[] = $aSearch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user