[TYPO3-Solr] Indexed tt_news records based on their category

Chuku Balentina [Netcreators] chuku at netcreators.nl
Fri Mar 6 14:28:51 CET 2015


Hello,

Has anyone configured solr tt_news index to indexed news records based 
on their category. I have an installation with approximate 15 sub-sites 
in it, and every sub-site has it's own detail page and storage folder.
The news items that must be displayed across multiple sub-sites(based on 
their category) are all stored in one storage folder located inside the 
first sub-site. With the configuration below i always get every new 
item(from current sub-site system folder and the additional system 
folder) instead of only the one's from the current sub-site and the 
others that matches the category from the from the current sub-site.

System specs:
TYPO3 6.2.10
Solr plugin 3.0.0
tt_news: 3.6.0

tt_news {
         additionalPageIds = 189 3 PID where where news items are stored 
to be displayed across multiple sub-site based on their category
         fields {
           pid = pid
           abstract = short
           author = author
           description = short
           title = title
           content = SOLR_CONTENT
           content {
             field = bodytext
           }
           category_stringM = SOLR_RELATION
           category_stringM {
             localField = category
             relationTableSortingField = sorting
             multiValue = 1
           }
           categoryMain_stringS = TEXT
           categoryMain_stringS {
             cObject = SOLR_RELATION
             cObject {
               localField = category
               relationTableSortingField = sorting
               singleValueGlue = ,
             }
             split {
               token = ,
               returnKey = 0
             }
           }
           keywords = SOLR_MULTIVALUE
           keywords {
             field = keywords
           }

           url = TEXT
           url {
                 typolink.parameter.cObject = CONTENT
                 typolink.parameter.cObject {
                    table = tt_news_cat
                    select {
                        pidInList = 189, 394
                        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
                 }
           }
         }
       }

-- 
Met vriendelijke groet,

Chuku Balentina
Medior TYPO3 developer / consultant

Tel. 026-442 1950
www.netcreators.nl
www.12socialmediamarketing.nl

Bezoekadres:
Klarendalseweg 71
6822GB  ARNHEM
-------------------------------------------------------------
Websites en Social Media die voor u werken!



More information about the TYPO3-project-solr mailing list