h4ck3r31 / solr-utility
此TYPO3扩展为ext:solr提供了一些实用工具
v1.0.2
2017-10-12 15:24 UTC
Requires
- typo3/cms-core: ^7.6 || ^8.6
This package is auto-updated.
Last update: 2024-09-16 19:56:22 UTC
README
内容对象
SOLR_BASECATEGORY
获取给定基本分类的下级分类标题。
属性
baseId
(int, required): 定义要从中检索下级子项的sys_category
的基本IDremoveEmptyValues
(bool, default: true): 是否移除没有分类标题的项multiValue
(bool, default: true): 是否返回多值数组singleValueGlue
(string, default: ","): 在禁用multiValue
的情况下,用于连接多个分类标题的字符filterIds
(int-list): 定义要在最终结果中保留的类别IDexcludeIds
(int-list): 定义要在最终结果中排除的类别ID - 在filterIds
和excludeIds
都存在值的情况下,具有优先级
示例
给定以下分类树,对于baseId=1
调用的SOLR_BASECATEGORY
内容对象将获取提交的基本分类的下级分类标题 - 在此示例中,结果将是只有["新闻", "产品", "事件", "新闻"]
。
- 1: 基础分类
- 11: 新闻
- 12: 产品
- 121: 新产品
- 122: 促销产品
- 13: 活动
- 14: 媒体
- 2: 产品分类
- 21: 软件
- 23: 书籍
plugin.tx_solr.index.queue {
pages {
fields {
baseCategory_stringM = SOLR_BASECATEGORY
baseCategory_stringM {
baseId = 1
localField = categories
multiValue = 1
# both filterIds and excludeIds
# result in "Press" being ignored
filterIds = 11,12,13
excludeIds = 14
}
示例:使用uid=1
获取基础分类的下级分类标题
索引
忽略页面ID约束
忽略索引实体(如默认情况下不可访问的实体)上的页面ID约束,例如在根页面上索引sys_file
项(pid=0
)。
plugin.tx_solr.index.queue {
document {
table = sys_file
additionalWhereClause = storage=1 AND identifier LIKE '/public-downloads/%'
initialization = GMK\BezirkOberfranken\Alternatives\Solr\DocumentInitializer
示例:在文件夹/public-downloads/
下索引存储1
的文件
防止未翻译的页面被索引
防止页面在未提供页面翻译的情况下被多次索引。这防止了在没有实际语言请求的情况下,使用具有真实语言的请求渲染内容的回退模式sys_language_uid=0
。
plugin.tx_solr.index.queue {
pages {
indexer = H4ck3r31\SolrUtility\IndexQueue\PreventNonTranslatedPageIndexer
示例:防止在内容回退模式下索引未翻译的页面