]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid multi-term partials in names
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Mar 2021 19:42:37 +0000 (20:42 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 11 Mar 2021 19:42:37 +0000 (20:42 +0100)
Names are either full words or single-word partial names.
Searching for multi-word partials yields exactly the same
result as with full words.

lib-php/SearchDescription.php

index 94cadda322ce5e1f113555bf71495d2b69028221..cde21f82d8e8d75de4dc36600da490bc0e9e54df 100644 (file)
@@ -356,6 +356,7 @@ class SearchDescription
 
         if ((!$this->sPostcode && !$this->aAddress && !$this->aAddressNonSearch)
             && ((empty($this->aName) && empty($this->aNameNonSearch)) || $this->iNamePhrase == $iPhrase)
+            && strpos($sToken, ' ') === false
         ) {
             $oSearch = clone $this;
             $oSearch->iSearchRank++;