From: Sarah Hoffmann Date: Thu, 1 Mar 2018 21:35:34 +0000 (+0100) Subject: for structured search only accept name terms from the first phrase X-Git-Tag: v3.2.0~117 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/fd920fba9b0ae1dd4baeb92223043214779b9abe for structured search only accept name terms from the first phrase Fixes #952. --- diff --git a/lib/SearchDescription.php b/lib/SearchDescription.php index 4ba28e35..c379fdf3 100644 --- a/lib/SearchDescription.php +++ b/lib/SearchDescription.php @@ -289,10 +289,14 @@ class SearchDescription $this->aFullNameAddress[$iWordID] = $iWordID; } } else { - $oSearch = clone $this; - $oSearch->iSearchRank++; - $oSearch->aName = array($iWordID => $iWordID); - $aNewSearches[] = $oSearch; + // in structured search only the first phrase can be the + // designated name + if ($sPhraseType == '' || $bFirstPhrase) { + $oSearch = clone $this; + $oSearch->iSearchRank++; + $oSearch->aName = array($iWordID => $iWordID); + $aNewSearches[] = $oSearch; + } } }