[TYPO3-Solr] multiple domain search

Ingo Renner ingo at typo3.org
Wed Dec 9 14:20:29 CET 2009


Axel Jindra wrote:

Hi Axel,

> I now tried solr and it works fine within the subtrees, but is it
> possible to display solr's search results across multiple domains and
> link them correctly to the according URL?

yes, that's possible, too. You have to modify the query before it's sent 
to the Solr server though. The query by default contains a filter that 
limits the search to a certain domain. There's a hook called 
"modifySearchQuery", hook into that and remove that filter:

/**
  * Modifies the given query, removes the filter on the siteHash field
  *
  * @param	tx_solr_Query	The query to modify
  * @return	tx_solr_Query	The modified query without the siteHash filter
  */
public function modifyQuery(tx_solr_Query $query) {
	$query->removeFilter('siteHash');
	return $query;
}


HTH
Ingo

-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2



More information about the TYPO3-project-solr mailing list