hmmh/solr-file-indexer 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hmmh/solr-file-indexer

Composer 安装命令:

composer require hmmh/solr-file-indexer

包简介

Solr file indexer for Typo3

README 文档

README

This extension gives you the capability to index individual documents using Solr.

Apache Tika, which is capable of detecting and extracting metadata from approx. 1200 different file types is used for document content analysis. The configuration for Tika can be implemented directly within the extension, Solr server functionality is then used for parsing.

Individual documents can be added to the search index for the default language or any localisation, likewise site roots can be selected for which the document is to indexed.

Installation

The extension has the following requirements:

  • TYPO3 CMS >= 12.4
  • PHP >= 8.1
  • EXT: TYPO3 Solr >= 12.0.0

The extension can be installed using composer.

After installation activate the extension within the extension manager.

Changes in v3

  • New mode to enable indexing: The setting of which document should be indexed is no longer made in the metadata. The setting is now made in File collections.
  • New command line task which handles the indexing process
  • New localization management: There is no longer a global setting to index documents for all languages. This is now controlled via file collections, which can be translated for the appropriate languages.
  • Replace Hooks with Events
  • Replace scheduler task for cleanup with a command line task
  • Remove Dashboard Widgest from this Extension (now available in hmmh/solr-file-indexer-admin)

Configuration

Example:

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
        }
      }
    }
  }
}

To activate the indexing configuration set "plugin.tx_solr.index.queue.sys_file_metadata" to "1".

Configure "allowedFileTypes" with a comma seperated list of permitted file types.

The "fields" parameter provides a mapping from the "sys_file_metadata" fields to the respective Solr "sys_file" fields.

Adding a document to the search index

Create or add a File collection, choose the type you want (folder, category, static) and select the desired site roots within the "Search" tab.

You have to set the scheduler task (Execute console command) "solr_file_indexer:item-queue-worker" as a recurring task, i.e. all 10 minutes. The task handles, which files are added or updated in the solr index queue and which has to removed. The index queue workers will add the document/metadata to the search index during the next cycle.

Whenever a file collection is deleted or set to hidden, the documents automatically removed from the corresponding Solr index queue and search index during the next cycle of "solr_file_indexer:item-queue-worker".

In order to index documents for all (or desired) languages, a file collection can either be created for language "All" or localized. A localized file collection can contain a different type and different documents.

Scheduler Tasks

There is a command line task "solr_file_indexer:delete-by-type" that can delete files types (i.e. "sys_file_metadata") from the search index. File types are deleted from the Solr server search index for all languages but only for a specified site root.

Also there is the task "solr_file_indexer:item-queue-worker" which is relevant for the indexing process and must integrated as recurring task.

hmmh/solr-file-indexer 适用场景与选型建议

hmmh/solr-file-indexer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 235.08k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2018 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「file」 「solr」 「tika」 「apache」 「typo3」 「indexer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 hmmh/solr-file-indexer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 hmmh/solr-file-indexer 我们能提供哪些服务?
定制开发 / 二次开发

基于 hmmh/solr-file-indexer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 235.08k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 33
  • 依赖项目数: 2
  • 推荐数: 1

GitHub 信息

  • Stars: 13
  • Watchers: 5
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2018-05-09