[TYPO3-Solr] tt_news with category single_pid
Ingo Renner
ingo at typo3.org
Tue Apr 17 13:09:01 CEST 2012
Am 17.04.12 12:39, schrieb Stefan Franke:
> Hello,
> I'm trying to index tt_news articles that have different detail pages depending on the category setting 'single_pid'. Is this possible with the current Solr version?
We did this on typo3.org
plugin.tx_solr.index.queue.tt_news.fields {
url.typolink.parameter.cObject = CONTENT
url.typolink.parameter.cObject {
table = tt_news_cat
select {
pidInList = 10, 433, 496
selectFields = single_pid
where = uid = ###categoryUid###
markers {
categoryUid.cObject = TEXT
categoryUid.cObject {
// get the category IDs, comma-separated
cObject = SOLR_RELATION
cObject {
localField = category
foreignLabelField = uid
relationTableSortingField = sorting
}
// explode on comma, return first element/category ID
split {
token = ,
returnKey = 0
}
}
}
}
renderObj = TEXT
renderObj.field = single_pid
}
}
Will work with v2.2. In v2.1 the SOLR_RELATION parameter
"relationTableSortingField" is missing...
until then you can use a PHP function of course
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