]> git.openstreetmap.org Git - nominatim.git/commitdiff
don't use tokens from country parameter in address field of searches
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 26 Jan 2015 20:59:36 +0000 (21:59 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 26 Jan 2015 20:59:36 +0000 (21:59 +0100)
fixes #218

lib/Geocode.php

index d96b6cb8e7c29dd801456bbd2187baf32abaa072..11e47d9a4d7263aa3ba6456b300f134556a26075 100644 (file)
                                                                        }
                                                                }
                                                        }
-                                                       if (isset($aValidTokens[$sToken]))
+                                                       // Look for partial matches.
+                                                       // Note that there is no point in adding country terms here
+                                                       // because country are omitted in the address.
+                                                       if (isset($aValidTokens[$sToken]) && $sPhraseType != 'country')
                                                        {
                                                                // Allow searching for a word - but at extra cost
                                                                foreach($aValidTokens[$sToken] as $aSearchTerm)