$oSearch->aAddress[$iWordID] = $iWordID;
$aNewSearches[] = $oSearch;
}
- } else {
+ } else if (empty($this->aNameNonSearch)) {
$oSearch = clone $this;
$oSearch->iSearchRank++;
$oSearch->aName = array($iWordID => $iWordID);
}
if ((!$this->sPostcode && !$this->aAddress && !$this->aAddressNonSearch)
- && (empty($this->aName) || $this->iNamePhrase == $iPhrase)
+ && ((empty($this->aName) && empty($this->aNameNonSearch)) || $this->iNamePhrase == $iPhrase)
) {
$oSearch = clone $this;
$oSearch->iSearchRank++;
+ if (empty($this->aName) && empty($this->aNameNonSearch)) {
+ $oSearch->iSearchRank++;
+ }
if (preg_match('#^[0-9 ]+$#', $sToken)) {
$oSearch->iSearchRank++;
}