TYPO3:索引搜索插件仅限于单个页面+子页面

huangapple go评论59阅读模式
英文:

TYPO3: Indexed Search plugin limited to a single page + subpages

问题

我正在使用TYPO3 11.5.27和indexed_search扩展。

是否可以将搜索限制在仅一个页面和相关子页面上?

英文:

I'm using TYPO3 11.5.27 and the indexed_search extension.

Is it possible to limit the search to only a page and relative subpages?

答案1

得分: 1

ext:indexed_search的文档中提到了关于设置rootPidList的提示:

通过"根页面",我们指的是由TypoScript模板定义的网站根!
如果您只想在站点的分支中进行搜索,
请使用在级别中搜索的可能性。

据我理解,您应该使用设置displayLevel1SectionsdisplayLevel2SectionsdisplayLevelxAllSections,逐级迭代到您想要从中获取搜索结果的分支的起点。
可能您可以在POST参数中预设这些值,以便从比Web根级别更高的页面开始搜索。

英文:

In the documentation of ext:indexed_search there is a hint at the setting rootPidList:

By "root page" we mean a website root defined by a TypoScript template! 
If you just want to search in branches of your site, 
use the possibility of searching in levels.

As I understand you should use the settings displayLevel1Sections, displayLevel2Sections and displayLevelxAllSections to iterate level to level to the start of the branch you want search results from.
Probably you can preset these values in POST parameters to start your search in a page branch starting with a page at a higher level than the web root.

答案2

得分: 0

在每个页面的设置中,都有一个名为“包含在搜索中”的切换按钮,在“行为”选项卡中。您可以在那里关闭或打开每个页面的索引。

我不知道有没有递归函数可以为整个子树执行此操作。

您可以这样做(但请谨慎!):

  • 备份您的数据库。真的!
  • 使用以下 SQL 查询直接在数据库中关闭所有页面的索引:
    UPDATE pages SET no_search = 1;
  • 在页面设置中为每个所需页面打开索引
  • 截断所有indexed_search数据库表:
     TRUNCATE TABLE index_phash;
     TRUNCATE TABLE index_fulltext;
     TRUNCATE TABLE index_rel;
     TRUNCATE TABLE index_words;
     TRUNCATE TABLE index_section;
     TRUNCATE TABLE index_grlist;
     TRUNCATE TABLE index_debug;
     TRUNCATE TABLE index_config;
     TRUNCATE TABLE index_stat_word;
    

完成后,您需要重新填充搜索索引。

对于将来创建的页面,您可以使用以下TSConfig将索引默认关闭:
TCAdefaults.pages.no_search = 1

如果您需要在索引中包含新创建的页面,则需要手动为该页面打开索引。

英文:

In the settings of each page there is the toggle "Include in Search" in the "Behaviour" tab. There you can switch indexing off or on for every page.

I'm not aware of a recursive function to do so for an entire subtree.

What you could do (but please with caution!):

  • Backup your database. Really!
  • Switch off indexing for every page directly in the database with this SQL query:
    UPDATE pages SET no_search = 1;
  • Turn indexing on in the page settings for every desired page
  • truncate all indexed_search database tables:
     TRUNCATE TABLE index_phash;
     TRUNCATE TABLE index_fulltext;
     TRUNCATE TABLE index_rel;
     TRUNCATE TABLE index_words;
     TRUNCATE TABLE index_section;
     TRUNCATE TABLE index_grlist;
     TRUNCATE TABLE index_debug;
     TRUNCATE TABLE index_config;
     TRUNCATE TABLE index_stat_word;
    

After that you need to fill the search index again.

For pages that will be created in the future you can turn off indexing by default with this TSConfig:
TCAdefaults.pages.no_search = 1

If you need a newly created page in the index, you need to switch indexing on manually for that page.

huangapple
  • 本文由 发表于 2023年7月17日 19:04:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76703817.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定