* Derive new searches by adding a full term to the existing search.
*
* @param object $oSearchTerm Description of the token.
- * @param bool $bHasPartial True if there are also tokens of partial terms
- * with the same name.
* @param string $sPhraseType Type of phrase the token is contained in.
* @param bool $bFirstToken True if the token is at the beginning of the
* query.
*
* @return SearchDescription[] List of derived search descriptions.
*/
- public function extendWithFullTerm($oSearchTerm, $bHasPartial, $sPhraseType, $bFirstToken, $bFirstPhrase, $bLastToken)
+ public function extendWithFullTerm($oSearchTerm, $sPhraseType, $bFirstToken, $bFirstPhrase, $bLastToken)
{
$aNewSearches = array();
$oSearch->iNamePhrase = -1;
$oSearch->sHouseNumber = $oSearchTerm->sToken;
$aNewSearches[] = $oSearch;
+
// Housenumbers may appear in the name when the place has its own
// address terms.
if ($oSearchTerm->iId !== null
// the first phrase. In unstructured search it may be in a later
// phrase when the first phrase is a house number.
if (!empty($this->aName) || !($bFirstPhrase || $sPhraseType == '')) {
- if (($sPhraseType == '' || !$bFirstPhrase) && !$bHasPartial) {
+ if (($sPhraseType == '' || !$bFirstPhrase) && $oSearchTerm->iTermCount > 1) {
$oSearch = clone $this;
$oSearch->iNamePhrase = -1;
- $oSearch->iSearchRank += 3 * $oSearchTerm->iTermCount;
+ $oSearch->iSearchRank += 1;
$oSearch->aAddress[$iWordID] = $iWordID;
$aNewSearches[] = $oSearch;
}