]> git.openstreetmap.org Git - nominatim.git/commitdiff
put a heavy penalty on full word searches in address
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Nov 2020 19:14:37 +0000 (20:14 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 3 Nov 2020 19:14:37 +0000 (20:14 +0100)
Experimentally downvote all searches with full words. They tend to
move down the actual good interpretation with partial searches.

lib/SearchDescription.php

index ad404528968ad94075bc414af0bc0f5a185873cc..52d15976c79a5dca12ebe291e91f6454d1edcbcc 100644 (file)
@@ -283,7 +283,7 @@ class SearchDescription
             if (!empty($this->aName) || !($bFirstPhrase || $sPhraseType == '')) {
                 if (($sPhraseType == '' || !$bFirstPhrase) && !$bHasPartial) {
                     $oSearch = clone $this;
-                    $oSearch->iSearchRank += 2;
+                    $oSearch->iSearchRank += 5;
                     $oSearch->aAddress[$iWordID] = $iWordID;
                     $aNewSearches[] = $oSearch;
                 } else {