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)0832↓50%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 1mo ago

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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

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

1160d 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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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