PHPackages                             fengdangxing/elasticsearch-dsl - 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. fengdangxing/elasticsearch-dsl

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

fengdangxing/elasticsearch-dsl
==============================

elasticsearch-dsl

v1.3.2(3y ago)010PHPPHP &gt;=5.6.0

Since Dec 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/fengdangxing/php-esql)[ Packagist](https://packagist.org/packages/fengdangxing/elasticsearch-dsl)[ RSS](/packages/fengdangxing-elasticsearch-dsl/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (32)Used By (0)

elasticsearch-dsl
=================

[](#elasticsearch-dsl)

```
#demo
$es = new User();
$es->createIndex();//创建索引
$id = 1;//文档id
$es->addData(['user_id' => 1, 'user_name' => 'ffff'], $id);//添加文档
$es->updateOne(['user_id' => 1, 'user_name' => 'ffff'], $id);//更新文档文档
$es
 #精准查询条件
 ->mustTerm(['user_id' => 1, 'user_name' => 'ffff'])
 #条件条件
 #gt: > 大于
 #lt: < 小于
 #gte: >= 大于或等于
 #lte: mustRange(['user_id' => ['gt', 0]])
 #desc/asc 排序
 ->orderBy(['user_id' => 'desc'])
 #分组 第一个参数=名称 第二个参数=字段 不分页
 ->groupBy('term_user_id', 'user_id', [$es->count('count', 'user_id', true)]);
 #聚合分页
 ->groupBy('term_user_id', 'user_id', [$es->count('count', 'user_id', true),$es->groupPage()]);
 #多个聚合
 ->groupBy('term_1', 'user_1', [$es->count('count', 'user_1', true),$es->groupPage()]);
 ->groupBy('term_2', 'user_2', [$es->count('count', 'user_2', true),$es->groupPage()]);

#执行dsl
$result = $es->queryDsl();
$es->getDsl(true);//打印dsl语句
var_dump($result);
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.1% 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.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~111 days

Total

30

Last Release

1201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5046433daacc52c8bf881825c043ab22e1ec865b2d32494515260e761fe2bf22?d=identicon)[fengdangxing](/maintainers/fengdangxing)

---

Top Contributors

[![jp811](https://avatars.githubusercontent.com/u/2242970?v=4)](https://github.com/jp811 "jp811 (32 commits)")[![fengdangxing](https://avatars.githubusercontent.com/u/24405972?v=4)](https://github.com/fengdangxing "fengdangxing (15 commits)")

---

Tags

elasticsearchDSLelasticsearch DSL

### Embed Badge

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

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

###  Alternatives

[mailerlite/laravel-elasticsearch

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

936603.4k2](/packages/mailerlite-laravel-elasticsearch)[matchish/laravel-scout-elasticsearch

Search among multiple models with ElasticSearch and Laravel Scout

7491.7M3](/packages/matchish-laravel-scout-elasticsearch)[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399672.8k](/packages/jeroen-g-explorer)[heyday/silverstripe-elastica

Provides Elastic Search integration for SilverStripe DataObjects using Elastica

1138.5k2](/packages/heyday-silverstripe-elastica)[blomstra/search

Replaces Flarum search with one powered by an elastic search server.

125.3k](/packages/blomstra-search)

PHPackages © 2026

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