[TYPO3-english] Crawler Configuration and protected content

Patrick Schriner patrick.schriner at diemedialen.de
Thu Sep 29 10:59:37 CEST 2011


On Wed, 28 Sep 2011 16:43:22 +0200, Russel Anderson <dkages at hotmail.com>  
wrote:

> Hello everyone,
>
> I manage a Typo3 website for an NGO that uses about 2 dozens of frontend  
> groups for about 3,000  frontend users. Consequently they have close to  
> 50 frontend group combinations.
>
> I am currently trying to setup indexed_search & crawler and it is my  
> understanding that the content must be crawled with all feuser  
> combinations so that all users can get fairly the same search results  
> [1].
>
> I don’t know how to configure indexed_search/crawler to fit all those  
> profiles. I mean, I want to avoid creating 50 crawler configuration  
> records in tree’s root (will result in astronomical crawler queue). As a  
> side note, I use sr_feuser_register to register all my users so they all  
> belong, at least, to a base group called "feuserapproved". I would be  
> satisfied that all users belonging "at least" to this group could see  
> all the content reserved for this group. Is it possible to achieve that  
> with indexed_search/crawler?
>
> Does anyone have a suggestion/workaround to this problem?

I solved this by creating an xclass to tx_indexedsearch

Roughly my solution goes like this:

class ux_tx_indexedsearch extends tx_indexedsearch {
	var $checkGroups;
	function initialize(){
		$this->checkGroups = $GLOBALS['TSFE']->gr_list;
		$groupfilter = $this->conf['ux.']['groupfilter'];
		if($groupfilter){
			$groupfilter = explode(',',$groupfilter);
			if(is_array($groupfilter)){
				$this->checkGroups = explode(',',$this->checkGroups);
				$this->checkGroups = array_diff($this->checkGroups,$groupfilter);
				$this->checkGroups = implode(',',$this->checkGroups);
			}
		}
		parent::initialize();
	}
	function checkResume($row)	{
		$save = $GLOBALS['TSFE']->gr_list;
		$GLOBALS['TSFE']->gr_list = $this->checkGroups;
		$result = parent::checkResume($row);
		$GLOBALS['TSFE']->gr_list = $save;
		return $result;
	}
}

This will make indexed_search "drop" those groups which are configured by  
ux.groupfilter. Thereby IF you know some groups are more like "marker  
groups" and not really used to distinguish content, you can lower you the  
number of search configurations considerably.

Originally I had planned to expand this to a full aliasing, but the above  
served our need well enough.

I could think of more elegant solutions, like checking "pages" and  
"tt_content" for usergroups that really occur.

Note: If you use an extension like pmkisac, you will have to apply a  
similar patch in that extension as well!

>
> Regards,
>
> Russel
>
> ---
> [1] On this topic, see Xavier’s excellent article:
>
> http://xavier.perseguers.ch/tutoriels/typo3/articles/indexed-search-crawler.html#c868
>
> Particularly the Protected Content section which says: “you have to  
> provide a Crawler Configuration for each and every subset of user groups  
> you have”

Regards,
Patrick Schriner


More information about the TYPO3-english mailing list