hmmh / solr-file-indexer
Typo3的Solr文件索引器
Requires
- php: >=8.1
- apache-solr-for-typo3/solr: ~12.0.0
- typo3/cms-core: ~12.4.4
- typo3/cms-install: ~12.4.4
Suggests
- apache-solr-for-typo3/tika: >=11.0
- hmmh/solr-file-indexer-admin: ~1.0.0
- typo3/cms-filemetadata: ~12.4.4
- dev-master
- 3.0.0
- 2.6.0
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.7
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.0
- dev-develop
- dev-release/3.0
- dev-release/2.6
- dev-feature/v12-compatibility
- dev-release/2.5
- dev-43-backward-compatibility-doctrine
- dev-release/2.4
- dev-release/2.3
- dev-feature/v11-compatibility
- dev-release/2.2
- dev-feature/dashboard-indexable-documents
- dev-release/2.1
- dev-release/2.0
- dev-release/1.3
- dev-release/1.3-develop
This package is auto-updated.
Last update: 2024-09-17 10:04:06 UTC
README
此扩展允许您使用Solr索引单个文档。
Apache Tika用于文档内容分析,它能够检测和提取约1200种不同文件类型的元数据。Tika的配置可以直接在扩展中实现,然后使用Solr服务器功能进行解析。
可以将单个文档添加到默认语言或任何本地化的搜索索引中,同样可以选择要索引的文档的网站根目录。
安装
扩展有以下要求
- TYPO3 CMS >= 12.4
- PHP >= 8.1
- EXT: TYPO3 Solr >= 12.0.0
可以使用composer安装此扩展。
安装后,在扩展管理器中激活扩展。
v3版本中的更改
- 新的索引模式:不再在元数据中设置应索引哪些文档,现在在文件集合中进行设置。
- 新的命令行任务,用于处理索引过程
- 新的本地化管理:不再有索引所有语言文档的全局设置。现在通过文件集合进行控制,可以翻译为适当的语言。
- 用事件替换钩子
- 用命令行任务替换清理的调度任务
- 从本扩展中删除仪表板小部件(现在可在hmmh/solr-file-indexer-admin中找到)
配置
示例
plugin.tx_solr {
index {
queue {
sys_file_metadata = 1
sys_file_metadata {
initialization = HMMH\SolrFileIndexer\IndexQueue\FileInitializer
indexer = HMMH\SolrFileIndexer\Indexer\FileIndexer
allowedFileTypes = pdf,doc,docx,xlsx
fields {
title = title
created = crdate
changed = tstamp
size_intS = SOLR_RELATION
size_intS {
localField = file
foreignLabelField = size
}
fileExtension = SOLR_RELATION
fileExtension {
localField = file
foreignLabelField = extension
}
title_stringS = SOLR_RELATION
title_stringS {
localField = file
foreignLabelField = name
}
description = description
keywords = keywords
author = creator
}
}
}
}
}
要激活索引配置,将"plugin.tx_solr.index.queue.sys_file_metadata"设置为"1"。
使用逗号分隔的列表配置"allowedFileTypes",指定允许的文件类型。
"fields"参数提供了从"sys_file_metadata"字段到相应的Solr"sys_file"字段的映射。
将文档添加到搜索索引
创建或添加一个文件集合,选择您想要的数据类型(文件夹、类别、静态),并在"搜索"选项卡中选择所需的网站根目录。
您必须设置调度任务(执行控制台命令)"solr_file_indexer:item-queue-worker"为重复任务,即每10分钟一次。该任务处理哪些文件被添加或更新到solr索引队列以及哪些需要删除。索引队列工作将在下一个周期中添加文档/元数据到搜索索引。
每当文件集合被删除或设置为隐藏时,文档将在下一个周期的"solr_file_indexer:item-queue-worker"周期中自动从相应的Solr索引队列和搜索索引中删除。
为了索引所有(或所需的)语言的文档,可以创建语言为"所有"或本地化的文件集合。本地化文件集合可以包含不同类型和不同文档。
调度任务
有一个命令行任务"solr_file_indexer:delete-by-type",可以删除搜索索引中的文件类型(即"sys_file_metadata")。文件类型将从所有语言的Solr服务器搜索索引中删除,但仅针对指定的网站根目录。
还有"solr_file_indexer:item-queue-worker"任务,对于索引过程非常重要,必须集成为重复任务。