Search result of News using SOLR Search giving http://{plugin.tx_news.settings.detailpid}/ instead of real URL in Typo3

740 Views Asked by At

I'm using TYPO3 7.6.10 and solr 6.5.0

Plugin: Apache solr for TYPO3 6.1.0

The search is working fine. I indexed Pages and News but when I get result of news it gives http://{plugin.tx_news.settings.detailpid}/ in URL instead of real URL.

I gave plugin.tx_news.settings.detailPid = 1130 in Constants of TYPOSCRIPT.

Please open below link and check the second result

http://www.fujifilm-mea.com/searchresult-page/?q=A+free+firmware+update+to+enhance+the+performance+of+the+FUJIFILM+X-Pro2+is+now+available+for+download&id=1263&L=0

4

There are 4 best solutions below

4
On

What is configured in plugin.tx_solr.index.queue.news.fields.url?

At least there seems to be a diffrence in the casing (detailpid <=> detailPid)

plugin.tx_news.settings.detailpid plugin.tx_news.settings.detailPid

0
On

This is not a valid TypoScript constant: {plugin.tx_news.settings.detailpid}

Please check your TypoScript Setup and change that to: {$plugin.tx_news.settings.detailpid}

https://wiki.typo3.org/TypoScript_Constants

0
On

in your root Setup:

plugin.tx_solr.index.queue {
news = 1
news {
    table = tx_news_domain_model_news
    fields {
        abstract = teaser
        author = author
        authorEmail_stringS = author_email
        title = title
        content = SOLR_CONTENT
        content {
            cObject = COA
            cObject {
                10 = TEXT
                10 {
                    field = bodytext
                    noTrimWrap = || |
                }
            }
        }

        url = TEXT
        url {
            typolink.parameter = {$plugin.tx_news.settings.detailPid}
            typolink.additionalParams = &tx_news_pi1[controller]=News&tx_news_pi1[action]=detail&tx_news_pi1[news]={field:uid}&L={field:__solr_index_language}
            typolink.additionalParams.insertData = 1
            typolink.useCacheHash = 1
            typolink.returnLast = url
        }
    }
    attachments {
        fields = related_files
    }
}

}

in root Constants:

plugin.tx_news.settings.detailPid = 3   //change "3" with ID of your NewsSingle Page

Clear all cache and Initialize Solr connections and re-index News again

0
On

The problem was for me in an old index. When correct pageUid added in constans.typoscript - need reindex news and all works