TYPO3 索引搜索不起作用 [英] TYPO3 Indexed Search not working

查看:35
本文介绍了TYPO3 索引搜索不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 TYPO3 版本 8,我已经安装了 indexed_search 表单框和排版

I'm using the TYPO3 version 8, I have installed the indexed_search form box with typoscript

50 = COA
50 {
    stdWrap {
        wrap = <div id="searchcontainer">|</div><div class="clearboth"></div>
        required = 1
    }

    10 = TEXT
    10 {
        wrap = <form id="searchbox" name="searchbox" action="|" method="post">
        typolink.parameter = {$searchPID}
        typolink.returnLast = url

        if.isTrue = {$config.tx_realurl_enable}
    }

    20 = TEXT
    20 {
        value = <form id="searchbox" name="searchbox" action="/" method="post">
        if.isFalse = {$config.tx_realurl_enable}
    }

    30 = COA
    30 {
        10 = TEXT
        10{
            wrap = <input type="hidden" name="id" value="|" />
            value = {$searchPID}
            if.isFalse = {$config.tx_realurl_enable}
        }

        20 = TEXT
        20 {
            wrap = <input type="text" id="swords" name="swords" value="|" size="20" onfocus="this.value='';" />
            value = {$searchTEXT}
        }

        30 = TEXT
        30 {
            wrap = <input type="submit" id="searchbutton" value="" />
        }
    }

    40 = TEXT
    40 {
        value = </form>
    }
}

当我点击搜索时,我被重定向到我的搜索页面,其中包含安装的搜索插件,但没有搜索结果,甚至没有显示关键字.页面索引良好,在后端索引中搜索关键字出现,但不在前端,我在这里缺少什么?请帮忙!

When I click on search, I'm redirected to my search page wich contain the search plugin installed, but no search results or even the keyword is showing. The pages are well indexed and in the backend indexing searched keyword it appears, but not in the frontend, what I'm mising here ? please help!

推荐答案

我找到了解决方案.你必须在typolink ts中添加一些东西(我的结果插件有_pi2 btw)

i found the solution. You have to add something to the typolink ts (my result plugin has _pi2 btw)

        wrap = <form id="searchbox" name="searchbox" action="|" method="post">
    typolink.parameter = 25  
    typolink.additionalParams = &tx_indexedsearch_pi2[action]=search&tx_indexedsearch_pi2[controller]=Search  
    typolink.returnLast = url
    typolink.useCacheHash = 1

第一次发帖:

我现在没有解决方案,但我找到了一些可以提供帮助的方法.

I don't have the solution right now, but i found something that could help.

我在使用 TYPO3 8 和搜索框时遇到了类似的问题.我调整了搜索框的 HTML,使其适合嵌入式插件,如下所示:

I'm having a similar problem with TYPO3 8 and a searchbox. I adapted my HTML of the searchbox, that it fits to the embedded plugin, like this:

<form action="searchresult.html?tx_indexedsearch_pi2%5Baction%5D=search&amp;tx_indexedsearch_pi2%5Bcontroller%5D=Search" method="post" name="searchform" id="searchform">
  <input name="tx_indexedsearch_pi2[search][sword]" type="text"/>
  <input name="tx_indexedsearch_pi2[search][submitButton]" type="submit" id="submitbutton" value="submit"/> 
...

如您所见,我的模板中有一个固定的设置.我注意到的是,如果您不在操作 url 中发送 chash,则嵌入式插件显然不会运行.也许你可以用你的打字稿生成它.

As you can see i have a fixed setup here in my template. What i noticed is, that the embedded plugin obviously doesn't run if you don't send the chash in the action url. Probably you can generate it with your typoscript.

我只是确定这是问题所在,至少对我而言是这样,因为当我关闭 extbase 的 chash 要求时,它可以工作......

I'm just sure that this is the problem, at least for my case, because when i turn the chash requirements for extbase off, it works ...

config.tx_extbase.features.requireCHashArgumentForActionArguments = 0

但我认为这有点冒险,不应该用于生产

but i believe that is a little bit risky and should not be used in production

所以生成 chash 应该是让它工作的方法.只是想分享我发现的.

so generating the chash should be the way to do make it work. just wanted to share what i found out.

这篇关于TYPO3 索引搜索不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆