]> git.openstreetmap.org Git - nominatim.git/commitdiff
further restrict use of partial terms in names
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 6 Oct 2017 19:36:28 +0000 (21:36 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 6 Oct 2017 19:36:28 +0000 (21:36 +0200)
lib/Geocode.php

index d221e672ebc047221ae8f5475ce5a2f5f6249823..f282e2656f2ebafeca651ed32307a0ee4534d451 100644 (file)
@@ -859,7 +859,8 @@ class Geocode
                                         }
                                     }
 
-                                    if (!sizeof($aCurrentSearch['aName']) || $aCurrentSearch['iNamePhrase'] == $iPhrase) {
+                                    if ((!$aCurrentSearch['sPostcode'] && !$aSearch['aAddress'] && !$aSearch['aAddressNonSearch'])
+                                        && (!sizeof($aCurrentSearch['aName']) || $aCurrentSearch['iNamePhrase'] == $iPhrase)) {
                                         $aSearch = $aCurrentSearch;
                                         $aSearch['iSearchRank'] += 1;
                                         if (!sizeof($aCurrentSearch['aName'])) $aSearch['iSearchRank'] += 1;