PHPackages                             guandeng/elasticsearch - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. guandeng/elasticsearch

ActiveLibrary[Search &amp; Filtering](/categories/search)

guandeng/elasticsearch
======================

A component for elasticsearch

08931[1 PRs](https://github.com/guandeng/elasticsearch/pulls)PHP

Since Jun 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/guandeng/elasticsearch)[ Packagist](https://packagist.org/packages/guandeng/elasticsearch)[ RSS](/packages/guandeng-elasticsearch/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

elasticsearch
=============

[](#elasticsearch)

[![Latest Stable Version](https://camo.githubusercontent.com/56092452656e187e208a5f9c1517764250f8a04e9b5e23547c8edc1646be80de/68747470733a2f2f706f7365722e707567782e6f72672f6775616e64656e672f656c61737469637365617263682f76657273696f6e2e706e67)](https://packagist.org/packages/guandeng/elasticsearch)[![Total Downloads](https://camo.githubusercontent.com/e3836b12779d886e6883d807682019c8b7bc86e050f1c4b87fc6fb25cb4fe6df/68747470733a2f2f706f7365722e707567782e6f72672f6775616e64656e672f656c61737469637365617263682f642f746f74616c2e706e67)](https://packagist.org/packages/guandeng/elasticsearch)[![GitHub license](https://camo.githubusercontent.com/6475e208919a96ad39015e2e6785e730186ac18883ba48381af47a64acc9353a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6775616e64656e672f656c6173746963736561726368)](https://github.com/guandeng/elasticsearch)

A component for elasticsearch

Installation
------------

[](#installation)

```
composer require guandeng/elasticsearch
```

Publish configure
-----------------

[](#publish-configure)

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

Usage
-----

[](#usage)

### Index

[](#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
-------

[](#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

[](#clientproxy)

```
namespace App\Proxy;

use Guandeng\Elasticsearch\ClientProxy;

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

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7838221?v=4)[guandeng](/maintainers/guandeng)[@guandeng](https://github.com/guandeng)

---

Top Contributors

[![guandeng](https://avatars.githubusercontent.com/u/7838221?v=4)](https://github.com/guandeng "guandeng (6 commits)")

### Embed Badge

![Health badge](/badges/guandeng-elasticsearch/health.svg)

```
[![Health](https://phpackages.com/badges/guandeng-elasticsearch/health.svg)](https://phpackages.com/packages/guandeng-elasticsearch)
```

###  Alternatives

[ircmaxell/filterus

A library for filtering variables in PHP

44613.4k6](/packages/ircmaxell-filterus)[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26190.2k](/packages/awesome-nova-dependent-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
