承接 guandeng/elasticsearch 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

guandeng/elasticsearch

Composer 安装命令:

composer require guandeng/elasticsearch

包简介

A component for elasticsearch

README 文档

README

Latest Stable Version Total Downloads GitHub license

A component for elasticsearch

Installation

composer require guandeng/elasticsearch

Publish configure

php bin/hyperf.php vendor:publish guandeng/elasticsearch

Usage

Index

  • Create
namespace App\Indices;

use Guandeng\Elasticsearch\Index\AbstractIndex;

class Test extends AbstractIndex
{
    protected $index = 'test';
}
  • Create by command
php bin/hyperf.php gen:index test
  • Query
use App\Indices\Test;

Test::query()->where(...)->search();
  • UpdateByQuery
use App\Indices\Test;

Test::query()->where(...)->script(['source' => 'ctx.source.xxx = value'])->updateByQuery();
  • Count
use App\Indices\Test;

Test::query()->where(...)->count();

Migrate

  • Index
namespace App\Indices;

use Guandeng\Elasticsearch\Index\AbstractIndex;

class Test extends AbstractIndex
{
    protected $index = 'test';
    protected $type = '_doc';
    protected $settings = [
        // your settings
    ];
    protected $properties = [
        // your properties
    ];

    public function getMigration(): Closure
    {
        return function ($index) {
            // migrate data
        };
    }
}
  • Run migrate
php bin/hyperf.php elasticsearch:migrate "App\\Indices\\Test" [--migrate] [--update] [--recreate]

ClientProxy

namespace App\Proxy;

use Guandeng\Elasticsearch\ClientProxy;

class FooClient extends ClientProxy
{
    protected $poolName = 'foo';
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-01