定制 code711/solrtools 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

code711/solrtools

Composer 安装命令:

composer require code711/solrtools

包简介

A set of CLI tools to manage Solr indexes for multi site setups

关键字:

README 文档

README

Latest Stable Version TYPO3 11 TYPO3 12 Total Downloads Monthly Downloads PHPSTAN:Level 9 build:passing Psalm coverage

This Extension provides CLI Tools to initialize the EXT:solr index queues from the command line, and to scan for file-references in the content to add the corresponding sites to the sys_file metadata where a file is being used.

The tools are aimed for installations with multiple sites. They will not do anything what could not be done in the TYPO3 Backend, but might save some time, or might be usefull in certain CI/CD Situations.

Additionally, a SolrEntityInterface is available for Extbase Models to update the solr index of a record if it has been changed through extbase in the frontend (similar to EXT:slug_extbase )

Changelog

2.0.8

  • added command solr:tools:indexqueueworker - this runs the indexer on all sites

2.0.1

  • Support of TYPO3 v11-v12
  • SolrfilemetaCommand.php does not set 'enable_indexing' for files on hidden pages or pages with restricted FE user access anymore

2.0.0

  • Support of TYPO3 v11-v12
  • SolrfilemetaCommand.php does not set 'enable_indexing' for files on hidden pages or pages with restricted FE user access anymore

1.2.0

  • better handling of non-solr-configured sites
  • added possibility to use the keyword 'all' with option -w/--what to create indexes for all configured tables in a site

1.1.1

  • better identifier for events

1.1.0

  • added Code711\SolrTools\Interfaces\SolrEntityInterface to enable Extbase models to update its index when persisted through extbase

1.0.2

  • added promised but missing scan for file-references in tt_content:header_link

1.0.1

  • Updated TER Description

1.0.0

  • Initial release

Code711\SolrTools\Interfaces\SolrEntityInterface

To enable this feature for your models simply add to the models class definition of your model, for example:

class MyModel extends TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements \Code711\SolrTools\Interfaces\SolrEntityInterface

now when persisting an object of this class, it will check if it is indexed in solr and if yes that its index will be added or updated through the normal scheduler process. The Interface itself has no further requirements and is only used as a marker to identify the models to watch out for.

solr:tools:createindex

./vendor/bin/typo3 solr:tools:createindex --help

Description:
  This tool creates (re)index tasks for solr per table and site or all sites

Usage:
  solr:tools:createindex [options] [--] ...

Arguments:
  site                  Site identifier or ALL for all sites

Options:
  -w, --what=WHAT       what to index (eq pages) (multiple values allowed). Enter "all" to index all configured pages
  -c, --cleanup         clean the solr index per site
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

This tool expects EXT:solr to be set up and configured in TYPO3.

Examples

This will create index-tasks for the table pages in all Sites and it will run cleanup before that

./vendor/bin/typo3 solr:tools:createindex -w pages --cleanup ALL

This will create index-tasks for the tables tx_news and sys_file_metadata in the sites with the identifiers customer1 and customer3

./vendor/bin/typo3 solr:tools:createindex -w tx_news -w sys_file_metadata customer1 customer3

The following will create index tasks for all tables in all sites

./vendor/bin/typo3 solr:tools:createindex -w all all

solr:tools:filemeta

This tool will search the file references table and the header_link and bodytext fields for files which match the given file extensions. It will then look up the corresponding site based on the page-id associated with the record and add that site id to the enable_indexing field provided by EXT:solr_file_indexer.

The tool will check if the element is visible (deleted=0, hidden=0) and if the page and its parent pages are visible, to ensure only 'active' files are added to the solr index.

./vendor/bin/typo3 solr:tools:filemeta --help

Description:
This tool searches for relations of files in the database and adds the correct site reference in the Files metadata, in order for EXT:solr to index those files correctly

Usage:
solr:tools:filemeta [options]

Options:
      --ext[=EXT]       File extensions to allow [default: ["doc","docx","pdf"]] (multiple values allowed)
  -c, --cleanup         clean the site field in all meta data
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

code711/solrtools 适用场景与选型建议

code711/solrtools 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.45k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 code711/solrtools 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-21