[TYPO3-Solr] Record indexing: TS from rootpage instead of storage folder. Bug of reature?

Ingo Renner ingo at typo3.org
Tue May 29 11:56:40 CEST 2012


Am 22.05.12 15:48, schrieb Stephan Schuler:

Hi Stephan,

> We discovered tx_solr_indexqueue_Indexer::getItemTypeConfiguration() to use $item->getRootPageUid() to determine the typoscript configuration being responsible for a single item.
> Wouldn’t it make more sense to use $item->getRecordPageId() instead?

If the page the record is located in a folder, you can't generate the TS 
for it since folders can not be rendered in FE.


>
> To provide a real world use case:
> We use several news storage folders with different types of news within the same root page/domain.
> Each of those folders has both, its very own list page and its own details page, which is caused by different content, layout and the need for different SOA friendly URLs in frontend.
>
> We use typoscript conditions to make each news list view use its own detail page by a simple PidInRootline. That’s nothing solr related but simply news/TYPO3 configuration.
>
> We tried to do the same with the storage folder as well to achieve this news records being indexed differently. But because of the tx_solr_indexqueue_Indexer::getIndextypeConfiguration() not using the exact storage folders typoscript representation but the corresponding rootpage instead, this doesn’t work.

The solution here is to use different indexing configuration for each 
folder.

newsA {
	additionalWhereClause = pid = A
	fields.url.typolink.parameter = detailA
}


newsB {
	additionalWhereClause = pid = B
	fields.url.typolink.parameter = detailB
}

...

The only issue with this right now is that the additionalWhereClause is 
taken into account only during Index Queue initialization, but not when 
creating new records. An idea how to solve this exists, but we haven't 
started working on it yet.


HTH
Ingo


-- 
Ingo Renner
TYPO3 Core Developer, Release Manager TYPO3 4.2, Admin Google Summer of Code

TYPO3 - Open Source Enterprise Content Management System
http://typo3.org

Apache Solr for TYPO3 -
Open Source Enterprise Search meets Open Source Enterprise CMS
http://www.typo3-solr.com


More information about the TYPO3-project-solr mailing list