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

0846↓100%1[1 PRs](https://github.com/guandeng/elasticsearch/pulls)PHP

Since Jun 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/guandeng/elasticsearch)[ Packagist](https://packagist.org/packages/guandeng/elasticsearch)[ RSS](/packages/guandeng-elasticsearch/feed)WikiDiscussions main Synced 1mo 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

19

—

LowBetter than 10% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity18

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://www.gravatar.com/avatar/fd1f44b3ef796447f75f090953483747b740450038a4b92107832699eaf8dedb?d=identicon)[guandeng](/maintainers/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

[ruflin/elastica

Elasticsearch Client

2.3k50.4M202](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[shyim/opensearch-php-dsl

OpenSearch/Elasticsearch DSL library

175.9M9](/packages/shyim-opensearch-php-dsl)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)

PHPackages © 2026

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