[TYPO3-english] Getting sys_category into URL for Apache Solr

Bert Bert
Mon Aug 31 10:55:43 CEST 2015


Hello,

Please see below for the snippet I use for indexing News with Apache 
Solr, works just fine.

However, now I want to extend the url with the category and 
parent-category the news-item belongs to (I adapted already the partial 
for the detailview for that).

Now, in order to have Apache Solr take these categories into account, I 
have to extend the URL-part for the typolink:
  typolink.additionalParams = 
&parentCat={field:parentCat}&cat={field:cat}&tx_news_pi1[news]={field:uid}&L={TSFE:sys_language_uid}

I guess I have to add a lookup by TS for the fields "cat" and 
"parentCat"...any pointers/ideas how to achieve this?

Thanks in advance!

Regards,
Bert Hiddink


##Actual snippet for Apache Solr
plugin.tx_solr.index.queue {
   news = 1
   news {
     table = tx_news_domain_model_news
     fields {
       abstract = teaser
       title = title
       content = SOLR_CONTENT
       content {
         cObject = COA
         cObject {
           10 = TEXT
           10 {
             field = bodytext
             noTrimWrap = || |
           }
           20 = TEXT
           20 {
             field = teaser
           }
         }
       }
       url = TEXT
       url {
         typolink.parameter = {$productDetailsPid}
         typolink.additionalParams = 
&tx_news_pi1[news]={field:uid}&L={TSFE:sys_language_uid} 

         typolink.additionalParams.insertData = 1
         typolink.useCacheHash = 1
         typolink.returnLast = url
       }
     }
   }
}


More information about the TYPO3-english mailing list