PHPackages                             makinacorpus/elasticsearch-query - 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. [API Development](/categories/api)
4. /
5. makinacorpus/elasticsearch-query

ActiveLibrary[API Development](/categories/api)

makinacorpus/elasticsearch-query
================================

ElasticSearch/OpenSearch query builder

1.0.0-alpha3(3y ago)0837↓93.8%GPL-2.0-or-laterPHPPHP &gt;=8.0

Since Mar 14Pushed 3y ago2 watchersCompare

[ Source](https://github.com/makinacorpus/php-elasticsearch-query)[ Packagist](https://packagist.org/packages/makinacorpus/elasticsearch-query)[ RSS](/packages/makinacorpus-elasticsearch-query/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

ElasticSearch 7.x / OpenSearch query builder
============================================

[](#elasticsearch-7x--opensearch-query-builder)

This is very small query builder for ElasticSearch and OpenSearch, mostly opiniated around building *bool* queries.

A simple example:

```
// Create a query.
$query = new RootBoolQuery();

// Add some filters.
$query->must()->term('statut', 20);

// Create a nested bool query, for nested objects.
$nested = $query->must()->createNestedBool('statut_histo');
$nested->must()->term('statut_histo.statut', 23);

// Set some query options.
$query->size(100);
$query->from(0);
$query->trackTotalHits();

// Add some sorts.
$query->sort('pushed_at');
$query->sort('created_at');

\json_encode($query->build(), JSON_PRETTY_PRINT);
```

Which will generated the follwoing JSON:

```
{
    "query": {
        "bool": {
            "must": [
                {
                    "term": {
                        "statut": 20
                    }
                },
                {
                    "nested": {
                        "path": "statut_histo",
                        "query": {
                            "bool": {
                                "must": {
                                    "term": {
                                        "statut_histo.statut": 23
                                    }
                                }
                            }
                        }
                    }
                }
            ]
        }
    },
    "from": 0,
    "size": 100,
    "track_total_hits": true,
    "sort": {
        "pushed_at": {
            "order": "asc"
        },
        "created_at": {
            "order": "asc"
        }
    }
}
```

More documentation may come later.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity38

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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

1206d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/69252826f3a70a19fc5dcefb7ef9d26d465bb300245641abb4dd89d0ec391a66?d=identicon)[pounard](/maintainers/pounard)

![](https://www.gravatar.com/avatar/d21b98752b406528da88850922b1061f39bf72eb2126b413d5c12e275811a40b?d=identicon)[Makina Corpus](/maintainers/Makina%20Corpus)

---

Top Contributors

[![pounard](https://avatars.githubusercontent.com/u/341855?v=4)](https://github.com/pounard "pounard (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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