Yes, the issue is still valid. Link generation with
return $this->pi_linkToPage($str,$id,$this->conf['result_link_target'],$urlParameters);
does not solve the problem as suggested by Lorenz. It returns realUrl links but prepends no (or the wrong) domain, if the mounted page resides outside the current domain or is stored in a page outside any domain tree (i.e. a shared folder holding the same mounted pages for multiple domains).
Since the mounted page and not the mountpoint itself is stored in index_phash pi_linkToPage returns the domain record of the mounted page.
I guess that's the reason why the current version (TYPO3 4.5.15) of pi/class.tx_indexedsearch.php is using:
return '<a href="'.htmlspecialchars($scheme.$firstDom.'/index.php?id='.$id.$addParams).'"'.$target.'>'.htmlspecialchars($str).'</a>'; insted.
Unfortunately the value for $firstDom is also wrong in the scenario described above and speaking urls are still not possible. I fixed this by adding another method for getting the domain record if $urlPrameters['MP'] is set.
...
$firstDom = current($this->domain_records[$id]);
if(isset($urlParameters['MP'])) {
$firstDom = $this->getDomainFromPageId($id,$urlParameters['MP']);
}
...
function getDomainFromPageId($id,$pathMP='') {
$identStr = $id.'|'.$pathMP;
if (!isset($this->cache_path[$identStr])) {
$this->fe_groups_required[$id] = array();
$this->domain_records[$id] = array();
$rl = $this->getRootLine($id,$pathMP);
$hitRoot = 0;
$sysDName = '';
if (is_array($rl) && count($rl)) {
foreach ($rl as $k => $v) {
// Check fe_user
if ($v['fe_group'] && ($v['uid']==$id || $v['extendToSubpages'])) {
$this->fe_groups_required[$id][]=$v['fe_group'];
}
// Check sys_domain.
if ($this->conf['search.']['detect_sys_domain_records']) {
$sysDName = $this->getFirstSysDomainRecordForPage($v['uid']);
if ($sysDName) {
$this->domain_records[$id][] = $sysDName;
break;
}
}
// Stop, if we find that the current id is the current root page.
if ($v['uid']==$GLOBALS['TSFE']->config['rootLine'][0]['uid']) {
break;
}
}
}
}
return $sysDName;
}