]> git.openstreetmap.org Git - nominatim.git/commitdiff
Give higher penalty to partial search terms
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 17 Dec 2017 15:00:44 +0000 (16:00 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 17 Dec 2017 15:00:44 +0000 (16:00 +0100)
Avoids that the interpreation of a term as partial term
is ranked higher than as a special term like postcode
or house number.

Fixes #847.

lib/SearchDescription.php

index bf45dadaf41adad4f1d586b56a3674baa9590388..60d7417347cd287083edd734ba681286085d0bba 100644 (file)
@@ -360,7 +360,7 @@ class SearchDescription
             && (!sizeof($this->aName) || $this->iNamePhrase == $iPhrase)
         ) {
             $oSearch = clone $this;
-            $oSearch->iSearchRank++;
+            $oSearch->iSearchRank += 2;
             if (!sizeof($this->aName)) {
                 $oSearch->iSearchRank += 1;
             }