我正在使用 CQ5 开箱即用的搜索组件。我的问题是错误页面显示在搜索结果中。
我可以知道如何限制错误页面在搜索中显示吗? 我们是否需要为页面添加一个新的属性,以便它可以被 QueryBuilder 限制?
最佳答案
如果您无法将您不希望被索引的内容与您所做的内容分开,则可以将搜索索引器配置为忽略特定内容或指定内容中的属性。这在 "How to modify the search engine configurations in CQ5 上有一些详细描述。 Adobe CQ Help 上的页面网站。
本质上,索引器可以通过将属性添加到 indexing_config.xml 文件来忽略它们,如下所示:
<index-rule nodeType="nt:base">
<!-- ... existing ignored properties -->
<property nodeScopeIndex="false">mySecretProperty</property>
</index-rule>
以下应排除具有特定资源类型的节点及其后代的页面。
<index-rule nodeType="nt:base" condition="@sling:resourceType='app/components/errorPage'" />
<index-rule nodeType="nt:base" condition="ancestor::*/@excludefromindex='app/components/errorPage'" />
长耳兔 Indexing Configuration页面有关于此文件语法的更多详细信息。
内容不会自动重新索引,可以找到如何触发重新索引的详细信息here .
关于java - 限制默认 cq5 搜索中的错误页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15639109/