]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
narrow down search by house number when postcode is given
[nominatim.git] / lib / Geocode.php
index d00104178fe7459de78789977c82b9fff7ca9565..68a9a7cb1aced88a11662f4dee533e43661b054e 100644 (file)
@@ -620,7 +620,7 @@ class Geocode
             }
 
             Debug::printDebugArray('Search context', $oCtx);
-            Debug::printDebugArray('Base search', $aSearches[0]);
+            Debug::printDebugArray('Base search', empty($aSearches) ? null : $aSearches[0]);
             Debug::printVar('Final query phrases', $aInPhrases);
 
             // Convert each phrase to standard form
@@ -658,7 +658,6 @@ class Geocode
                     $this->oDB->getAll($sSQL),
                     'Could not get word tokens.'
                 );
-                $aWordFrequencyScores = array();
                 foreach ($aDatabaseWords as $aToken) {
                     // Filter country tokens that do not match restricted countries.
                     if ($this->aCountryCodes
@@ -681,7 +680,6 @@ class Geocode
                     } else {
                         $aValidTokens[$aToken['word_token']] = array($aToken);
                     }
-                    $aWordFrequencyScores[$aToken['word_id']] = $aToken['search_name_count'] + 1;
                 }
 
                 // US ZIP+4 codes - if there is no token, merge in the 5-digit ZIP code
@@ -781,7 +779,6 @@ class Geocode
 
                     $aResults += $oSearch->query(
                         $this->oDB,
-                        $aWordFrequencyScores,
                         $this->iMinAddressRank,
                         $this->iMaxAddressRank,
                         $this->iLimit