X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/d42aa0870592b36ba9c64eae05a0ceafd2467f4c..c3940466b817a4c10a956f61c43d6bee3214dd40:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index ae518d51..97fc6371 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -19,7 +19,7 @@ class Geocode protected $bIncludeAddressDetails = false; protected $aExcludePlaceIDs = array(); - protected $bReverseInPlan = false; + protected $bReverseInPlan = true; protected $iLimit = 20; protected $iFinalLimit = 10; @@ -345,8 +345,6 @@ class Geocode Score how good the search is so they can be ordered */ - $iGlobalRank = 0; - foreach ($aPhrases as $iPhrase => $oPhrase) { $aNewPhraseSearches = array(); $sPhraseType = $bIsStructured ? $oPhrase->getPhraseType() : ''; @@ -378,8 +376,7 @@ class Geocode $iToken == 0 && $iPhrase == 0, $iPhrase == 0, $iToken + 1 == sizeof($aWordset) - && $iPhrase + 1 == sizeof($aPhrases), - $iGlobalRank + && $iPhrase + 1 == sizeof($aPhrases) ); foreach ($aNewSearches as $oSearch) { @@ -460,7 +457,7 @@ class Geocode continue; } - $iRank = $oSearch->addToRank($iGlobalRank); + $iRank = $oSearch->getRank(); if (!isset($aGroupedSearches[$iRank])) { $aGroupedSearches[$iRank] = array(); }