From fd920fba9b0ae1dd4baeb92223043214779b9abe Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 1 Mar 2018 22:35:34 +0100 Subject: [PATCH] for structured search only accept name terms from the first phrase Fixes #952. --- lib/SearchDescription.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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; + } } } -- 2.45.2