定制 devouted/elastic-index-manager 二次开发

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

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

devouted/elastic-index-manager

最新稳定版本:v2.0.2

Composer 安装命令:

composer require devouted/elastic-index-manager

包简介

About

README 文档

README

A Symfony console tool for managing Elasticsearch indexes interactively.

Requirements

  • PHP 8.2+
  • Symfony 7.3+
  • Elasticsearch PHP client 8.x

Installation

composer require devouted/elastic-index-manager

Configuration

Register the command in your services.yaml:

Devouted\ElasticIndexManager\Command\ElasticIndexManagerCommand:
    tags: ['console.command']

The command automatically discovers any service returning an Elastic\Elasticsearch\Client or Elastic\Elasticsearch\ClientBuilder instance. Example service definition:

elasticsearch.client.default:
    public: true
    class: Elastic\Elasticsearch\ClientBuilder
    factory: [ 'Elastic\Elasticsearch\ClientBuilder', 'create' ]
    calls:
        - [ setHosts, [ [ '%env(ELASTICSEARCH_TRANSPORT)%://%env(ELASTICSEARCH_HOST)%:%env(ELASTICSEARCH_PORT)%' ] ] ]

Usage

bin/console elasticsearch:index:manage

Connection selection

Choose which Elasticsearch connection to use from discovered services.

image

Index management

Once connected, you get an interactive table of all indexes with a summary footer showing totals for document counts and storage sizes.

image2

Available actions

Action Description
Change Elastic Client Switch to a different ES connection
Filter for empty indexes Show only indexes with docs.count = 0
Filter by index pattern Filter indexes by name pattern
Reset filter Remove active filter
Sort Sort by any column (asc/desc), supports size unit conversion
Show Index Mapping View field mappings and fetch sample data for a selected index
Delete an index Delete a single index (with confirmation)
Delete all indexes by filter Bulk delete all currently filtered indexes (with confirmation)

Testing

vendor/bin/simple-phpunit

Unit tests cover:

  • ListSorter — byte conversion, index sorting by various columns
  • FilterByNameOfIndexes — pattern matching filter
  • FilterNotEmptyIndexes — empty index filter

Integration tests require a running Symfony kernel with Elasticsearch connection.

License

MIT

统计信息

  • 总下载量: 960
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-11-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固