flowpack/elasticsearch-contentrepositoryqueueindexer

基于作业队列的Neos CMS Elasticsearch索引器

5.2.2 2022-05-29 13:13 UTC

README

Latest Stable Version Total Downloads

此软件包可用于在Elasticsearch索引中索引大量节点。此软件包使用Flowpack JobQueue软件包来异步处理索引。

主题

安装和配置

您需要根据需求安装正确的队列软件包。

可用软件包

请检查软件包文档以获取特定配置。

默认配置使用FakeQueue,由JobQueue.Common软件包提供。注意,使用该软件包时,作业将与flow nodeindexqueue:build命令同步执行。

检查Settings.yaml以根据队列软件包进行适配,您需要适配className

Flowpack:
  JobQueue:
    Common:
      presets:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          className: 'Flowpack\JobQueue\Common\Queue\FakeQueue'

如果您使用doctrine软件包,您必须手动设置tableName

Flowpack:
  JobQueue:
    Common:
      presets:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          className: 'Flowpack\JobQueue\Doctrine\Queue\DoctrineQueue'
      queues:
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer':
          options:
            tableName: 'flowpack_jobqueue_QueueIndexer'
        'Flowpack.ElasticSearch.ContentRepositoryQueueIndexer.Live':
          options:
            tableName: 'flowpack_jobqueue_QueueIndexerLive'

索引

批量索引

如何构建索引作业

flow nodeindexqueue:build --workspace live

如何处理索引作业

您可以使用此CLI命令处理索引作业

flow nodeindexqueue:work --queue batch

实时索引

您可以通过编辑Settings.yaml禁用异步实时索引

Flowpack:
  ElasticSearch:
    ContentRepositoryQueueIndexer:
      enableLiveAsyncIndexing: false

您可以使用此CLI命令处理索引作业

flow nodeindexqueue:work --queue live

Supervisord配置

您可以使用像supervisord这样的工具来管理长时间运行的过程。以下是一个基本配置

[supervisord]

[supervisorctl]

[program:elasticsearch_batch_indexing]
command=php flow nodeindexqueue:work --queue batch
stdout_logfile=AUTO
stderr_logfile=AUTO
numprocs=4
process_name=elasticsearch_batch_indexing_%(process_num)02d
environment=FLOW_CONTEXT="Production"
autostart=true
autorestart=true
stopsignal=QUIT

[program:elasticsearch_live_indexing]
command=php flow nodeindexqueue:work --queue live
stdout_logfile=AUTO
stderr_logfile=AUTO
numprocs=4
process_name=elasticsearch_live_indexing_%(process_num)02d
environment=FLOW_CONTEXT="Production"
autostart=true
autorestart=true
stopsignal=QUIT

更新说明

升级到3.0后的重大更改

  • 以前,Beanstalk队列软件包默认安装,现在不再是这种情况。

升级到5.0后的重大更改

  • 已删除Beanstalk队列配置。如果没有配置其他队列软件包,则使用FakeQueue。

许可证

许可协议为MIT,请参阅LICENSE