]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/Geocode.php
do not allow importance to become 0
[nominatim.git] / lib / Geocode.php
index 643af8e12784bac4cf92723050522e0aab1f0ced..184fd0f540974795178540d178a9f69133419924 100644 (file)
@@ -921,12 +921,12 @@ class Geocode
                 $aResult['importance'] = 0.001;
                 $aResult['foundorder'] = $aResult['addressimportance'];
             } else {
-                // Adjust importance for the number of exact string matches in the result
+                $aResult['importance'] = max(0.001, $aResult['importance']);
                 $aResult['importance'] *= $this->viewboxImportanceFactor(
                     $aResult['lon'],
                     $aResult['lat']
                 );
-                $aResult['importance'] = max(0.001, $aResult['importance']);
+                // Adjust importance for the number of exact string matches in the result
                 $iCountWords = 0;
                 $sAddress = $aResult['langaddress'];
                 foreach ($aRecheckWords as $i => $sWord) {