搜索结果使用SOLR搜索提供http:// {plugin.tx_news.settings.detailpid} /而不是Typo3中的真实URL

时间:2017-09-06 09:37:14

标签: solr typo3 tx-news

我正在使用TYPO3 7.6.10和solr 6.5.0

插件:适用于TYPO3 6.1.0的Apache solr

搜索工作正常。我将页面和新闻编入索引,但是当我得到新闻结果时,它会在URL中提供http://{plugin.tx_news.settings.detailpid}/而不是真实的网址。

我在TYPOSCRIPT的常量中给了plugin.tx_news.settings.detailPid = 1130

请打开以下链接并查看第二个结果

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

3 个答案:

答案 0 :(得分:0)

plugin.tx_solr.index.queue.news.fields.url中配置了什么?

至少在套管中似乎存在差异(detailpid< => detailPid)

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

答案 1 :(得分:0)

这不是有效的TypoScript常量: {plugin.tx_news.settings.detailpid}

请检查您的TypoScript设置并将其更改为: {$ plugin.tx_news.settings.detailpid}

https://wiki.typo3.org/TypoScript_Constants

答案 2 :(得分:0)

在您的根设置中:

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
    }
}

}

在根常量中:

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

清除所有缓存并初始化Solr连接并重新为新闻重新编制索引