PHPackages                             phpfluent/elastic-query-builder - 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. phpfluent/elastic-query-builder

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

phpfluent/elastic-query-builder
===============================

A fluent query builder for Elastic Search.

1.0(13y ago)2525.0k5[3 issues](https://github.com/PHPFluent/ElasticQueryBuilder/issues)New BSDPHP

Since Feb 24Pushed 4y ago2 watchersCompare

[ Source](https://github.com/PHPFluent/ElasticQueryBuilder)[ Packagist](https://packagist.org/packages/phpfluent/elastic-query-builder)[ Docs](http://github.com/PHPFluent/ElasticQueryBuilder)[ RSS](/packages/phpfluent-elastic-query-builder/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

ElasticQueryBuilder
===================

[](#elasticquerybuilder)

[![Build Status](https://camo.githubusercontent.com/379df8aeeeb380342ec267435dfa14087bc03ae6e46929f66229240c9c8b386f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f504850466c75656e742f456c617374696351756572794275696c6465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](http://travis-ci.org/PHPFluent/ElasticQueryBuilder)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2c9896e59f5b304c3731768d33adbd708c1f2322a1882910837fed731a7d5f61/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f504850466c75656e742f456c617374696351756572794275696c6465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PHPFluent/ElasticQueryBuilder/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/8f10b866d89fcff3d9ee7f685108ae879c9827d1d32a919efbaa032bb9670080/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f504850466c75656e742f456c617374696351756572794275696c6465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PHPFluent/ElasticQueryBuilder/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/adf9ee5535f906b793c4d529f959d5ae5aaf28ee457aa77ab313dc5b5f875143/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706870666c75656e742f656c61737469632d71756572792d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/elastic-query-builder)[![Total Downloads](https://camo.githubusercontent.com/930339ecdd26de9da8b7c5312395c3dba0ce8f8b8eecddf2563f1b3c97097fd5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706870666c75656e742f656c61737469632d71756572792d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/elastic-query-builder)[![License](https://camo.githubusercontent.com/2eba14146e87a5b2bb15560f51b2141bebdf1c9e30255e7a06e5f51ac4b030ef/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f706870666c75656e742f656c61737469632d71756572792d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpfluent/elastic-query-builder)

A fluent query builder for Elastic Search.

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

[](#installation)

Package is available on [Packagist](http://packagist.org/packages/phpfluent/elastic-query-builder), you can install it using [Composer](http://getcomposer.org).

```
composer require phpfluent/elastic-query-builder
```

[PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.5+ are required.

Usage
-----

[](#usage)

```
$builder = new Query();
$builder->query()->filtered()->query()->matchAll(new stdClass());
$builder->query()->filtered()->filter()->and(
    [
        new Term('my.nested.label', 'my_value'),
        new Term('my_label', 'other_value'),
    ]
);

echo $builder.PHP_EOL;
```

The result of the code above is:

```
{"query":{"filtered":{"query":{"match_all":{}},"filter":{"and":[{"term":{"my.nested.label":"my_value"}},{"term":{"my_label":"other_value"}}]}}}}
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

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

Unknown

Total

1

Last Release

4867d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/154023?v=4)[Henrique Moody](/maintainers/henriquemoody)[@henriquemoody](https://github.com/henriquemoody)

![](https://www.gravatar.com/avatar/d0ac2250592af3b5a1971d373e9dc5bbc2a3279e3f92045bfbb5abe9eeb4d113?d=identicon)[kinncj](/maintainers/kinncj)

---

Top Contributors

[![kinncj](https://avatars.githubusercontent.com/u/292542?v=4)](https://github.com/kinncj "kinncj (20 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phpfluent-elastic-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/phpfluent-elastic-query-builder/health.svg)](https://phpackages.com/packages/phpfluent-elastic-query-builder)
```

###  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)
