X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7fba4ec99738cc69ee773e7f79418a9353029aaa..e42d5e09e70aa884873e5d76f0745ed196dc1d9a:/website/search.php?ds=sidebyside
diff --git a/website/search.php b/website/search.php
index 59d57d58..c165b92b 100755
--- a/website/search.php
+++ b/website/search.php
@@ -421,12 +421,12 @@
{
$aNewPhraseSearches = array();
- foreach($aPhrases[$iPhrase]['wordsets'] as $iWordset => $aWordset)
+ foreach($aPhrases[$iPhrase]['wordsets'] as $aWordset)
{
$aWordsetSearches = $aSearches;
// Add all words from this wordset
- foreach($aWordset as $sToken)
+ foreach($aWordset as $iToken => $sToken)
{
//echo "
$sToken";
$aNewWordsetSearches = array();
@@ -450,7 +450,7 @@
{
$aSearch['sCountryCode'] = strtolower($aSearchTerm['country_code']);
// Country is almost always at the end of the string - increase score for finding it anywhere else (optimisation)
- if ($iWordset+1 != sizeof($aPhrases[$iPhrase]['wordsets']) || $iPhrase+1 != sizeof($aPhrases)) $aSearch['iSearchRank'] += 5;
+ if ($iToken+1 != sizeof($aWordset) || $iPhrase+1 != sizeof($aPhrases)) $aSearch['iSearchRank'] += 5;
if ($aSearch['iSearchRank'] < $iMaxRank) $aNewWordsetSearches[] = $aSearch;
}
}