PHPackages                             mapado/elastica-query-bundle - 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. mapado/elastica-query-bundle

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

mapado/elastica-query-bundle
============================

Query builder bundle for ElasticSearch

v3.0.1(7y ago)126.1k1MITPHPPHP ^7.2

Since Aug 19Pushed 7y ago5 watchersCompare

[ Source](https://github.com/mapado/elastica-query-bundle)[ Packagist](https://packagist.org/packages/mapado/elastica-query-bundle)[ RSS](/packages/mapado-elastica-query-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (9)Versions (23)Used By (0)

Elastica Query Bundle
=====================

[](#elastica-query-bundle)

Inspired by FOSElasticaBundle and Doctrine to create a query builder for ElasticSearch.

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

[](#installation)

```
composer require "mapado/elastica-query-bundle:1.*"
```

Configuation
------------

[](#configuation)

```
# app/config/config.yml
mapado_elastica_query:
    clients:
        client_name:
            host: elasticsearch.example.com
            port: 9200
            timeout: 3

    indexes:
        twitter:
            # (optional, default to 'twitter') index_name: twitter_v1
            client: client_name
            types:
                tweet: ~

    document_managers:
        tweety:
            type: mapado.elastica.type.twitter.tweet
            # data_transformer: my.model.transformer #optional, must implements Mapado\ElasticaQueryBundle\DataTransformer\DataTransformerInterface
            # query_builder_classname: Acme\\Demo\\QueryBuilder\\TweetyQueryBuilder # @see "Overide Query Builder" section
```

Usage
-----

[](#usage)

### Get DocumentManager

[](#get-documentmanager)

```
$client = $this->get('mapado.elastica.client.client_name'); // return a \Elastica\Client object
$index = $this->get('mapado.elastica.index.twitter');       // return a \Elastica\Index object
$type = $this->get('mapado.elastica.type.twitter.tweet');   // return a \Elastica\Type object
```

### Get elastica objects

[](#get-elastica-objects)

You can fetch basic Elastica objects just by doing this:

```
$documentManager = $this->get('mapado.elastica.document_manager.tweety'); // return a \Mapado\ElasticaQueryBundle\DocumentManager
$queryBuilder = $documentManager->createQueryBuilder();

$queryBuilder->addQuery(new \Elastica\Query\Term(['field' => 'value']))
    ->addFilter(new \Elastica\Filter\Term(['field' => 'value']));
    ->setMaxResults(20)
    ->setFirstResults(40);

$tweets = $queryBuilder->getResult(); // return a \Mapado\Elastica\Model\SearchResult
```

### Overide Query Builder

[](#overide-query-builder)

You can override querybuilder doing this is your config file:

```
mapado_elastica_query:
    # ...
    document_managers:
        tweety:
            type: mapado.elastica.type.twitter.tweet
            query_builder_classname: 'Acme\Demo\QueryBuilder\TweetyQueryBuilder'
```

The QueryBuilder class must inherit from [`Mapado\ElasticaQueryBundle\QueryBuilder`](https://github.com/mapado/elastica-query-bundle/blob/master/src/QueryBuilder.php)

[![SensioLabsInsight](https://camo.githubusercontent.com/beb3b3b7490292fbe7c0f6ed7c2d74bcc6badefdb33212d0287c36c60b79deee/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f36393934653133372d376339322d346633662d393535342d6230653063313864336161652f6269672e706e67)](https://insight.sensiolabs.com/projects/6994e137-7c92-4f3f-9554-b0e0c18d3aae)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~69 days

Recently: every ~272 days

Total

22

Last Release

2870d ago

Major Versions

v1.7.1 → v2.0.02017-03-09

v2.0.0 → v3.0.02018-08-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/3277986d0e1f93c7e8a58fdaf1b52e3f5a1588e73dfa298d33aafb1ebbde5ef2?d=identicon)[jdeniau](/maintainers/jdeniau)

![](https://www.gravatar.com/avatar/90d135128b469dc38fcf186ac78d0f2cd82fc696ffcf5be8a8c486b7bd911ff6?d=identicon)[mapado](/maintainers/mapado)

---

Top Contributors

[![jdeniau](https://avatars.githubusercontent.com/u/1398469?v=4)](https://github.com/jdeniau "jdeniau (61 commits)")[![johndodev](https://avatars.githubusercontent.com/u/2741956?v=4)](https://github.com/johndodev "johndodev (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mapado-elastica-query-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/mapado-elastica-query-bundle/health.svg)](https://phpackages.com/packages/mapado-elastica-query-bundle)
```

PHPackages © 2026

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