PHPackages                             grouby/elasticsearch-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. grouby/elasticsearch-bundle

ActiveSymfony-bundle

grouby/elasticsearch-bundle
===========================

Elasticsearch bundle for Symfony.

v5.7.2.5(7y ago)08MITPHPPHP &gt;=5.6

Since Oct 30Pushed 7y agoCompare

[ Source](https://github.com/grouby/ElasticsearchBundle)[ Packagist](https://packagist.org/packages/grouby/elasticsearch-bundle)[ Docs](http://ongr.io)[ RSS](/packages/grouby-elasticsearch-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (22)Versions (77)Used By (0)

ONGR Elasticsearch Bundle
=========================

[](#ongr-elasticsearch-bundle)

Elasticsearch Bundle was created in order to serve the need for professional [Elasticsearch](https://www.elastic.co/products/elasticsearch) integration with enterprise level Symfony applications. This bundle is:

- Supported by [ONGR.io](http://ongr.io) development team.
- Uses the official [elasticsearch-php](https://github.com/elastic/elasticsearch-php) client.
- Ensures full integration with Symfony framework.

Technical goodies:

- Provides interactive Document object generator via CLI (`ongr:es:document:generate`)
- Provides DSL query builder to be executed by type repository services.
- Uses Doctrine-like documents(entities) document-object mapping using annotations.
- Query results iterators are provided for your convenience.
- Console CLI commands for index and types management and data import / export.
- Profiler that integrates in the Symfony debug bar and shows all executed queries.
- Designed in an extensible way for all your custom needs.

If you need any help, [stack overflow](http://stackoverflow.com/questions/tagged/ongr)is the preferred and recommended way to ask questions about ONGR bundles and libraries.

[![Build Status](https://camo.githubusercontent.com/f0f8a9b596686eedd9f299ef6a0032bc713253953305a2513695e9a95086924f/68747470733a2f2f7472617669732d63692e6f72672f6f6e67722d696f2f456c617374696373656172636842756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ongr-io/ElasticsearchBundle)[![Coverage Status](https://camo.githubusercontent.com/9bd889f868b5a265b3513dd9c6d2a136a70ffc38eec863561f808b8aa355d08b/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6f6e67722d696f2f456c617374696373656172636842756e646c652f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/ongr-io/ElasticsearchBundle?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/ffa6c9dde416e6ed52d0fda608b15875da7ecd41484302a03f78b9edb5bc39c8/68747470733a2f2f706f7365722e707567782e6f72672f6f6e67722f656c61737469637365617263682d62756e646c652f762f737461626c65)](https://packagist.org/packages/ongr/elasticsearch-bundle)[![Total Downloads](https://camo.githubusercontent.com/c34ccd57a73430c2aedb4057765ae947d3483169a28a2b01628630f87c0d3666/68747470733a2f2f706f7365722e707567782e6f72672f6f6e67722f656c61737469637365617263682d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/ongr/elasticsearch-bundle)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/1e1d808f0c3aae0eb4b47ccd827a1a98684105413ef6f5d208537bed39ec1fd4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6f6e67722d696f2f456c617374696373656172636842756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ongr-io/ElasticsearchBundle/?branch=master)

Version matrix
--------------

[](#version-matrix)

Elasticsearch versionElasticsearchBundle version&gt;= 5.0~5.x&gt;= 2.0, &lt; 5.0&gt;=1.0, &lt; 5.0&gt;= 1.0, &lt; 2.0&gt;= 0.10, &lt; 1.0&lt;= 0.90.x&lt; 0.10Documentation
-------------

[](#documentation)

The online documentation of the bundle can be found in [http://docs.ongr.io](http://docs.ongr.io/ElasticsearchBundle). Docs source is stored within the repo under `Resources/doc/`, so if you see a typo or problem, please submit a PR to fix it!

For contribution to the documentation you can find it in the [contribute](http://docs.ongr.io/common/Contributing) topic.

FAQ
---

[](#faq)

- [Mapping explained](http://docs.ongr.io/ElasticsearchBundle/mapping)
- [Using Meta-Fields](http://docs.ongr.io/ElasticsearchBundle/meta_fields)
- [Configuration](http://docs.ongr.io/ElasticsearchBundle/configuration)
- [Console commands](http://docs.ongr.io/ElasticsearchBundle/commands)
- [How to do a simple CRUD actions](http://docs.ongr.io/ElasticsearchBundle/crud)
- [Quick find functions](http://docs.ongr.io/ElasticsearchBundle/find_functions)
- [How to search the index](http://docs.ongr.io/ElasticsearchBundle/search)
- [Scan through the index](http://docs.ongr.io/ElasticsearchBundle/scan)
- [Parsing the results](http://docs.ongr.io/ElasticsearchBundle/results_parsing)

Setup the bundle
----------------

[](#setup-the-bundle)

#### Step 1: Install Elasticsearch bundle

[](#step-1-install-elasticsearch-bundle)

Elasticsearch bundle is installed using [Composer](https://getcomposer.org).

```
php composer.phar require ongr/elasticsearch-bundle "~5.0"
```

> Instructions for installing and deploying Elasticsearch can be found in [Elasticsearch installation page](https://www.elastic.co/downloads/elasticsearch).

Enable Elasticsearch bundle in your AppKernel:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...
        new ONGR\ElasticsearchBundle\ONGRElasticsearchBundle(),
    ];

    // ...
}
```

#### Step 2: Add configuration

[](#step-2-add-configuration)

Add minimal configuration for Elasticsearch bundle.

```
# app/config/config.yml

ongr_elasticsearch:
    managers:
        default:
            index:
                index_name: acme
            mappings:
                - AppBundle
```

> This is the very basic example only, for more information, please take a look at the [configuration](http://docs.ongr.io/ElasticsearchBundle/configuration) chapter.

In this particular example there are 2 things you should know. The index name in the index node and the mappings. Mappings is the place where your documents are stored (more info at [the mapping chapter](http://docs.ongr.io/ElasticsearchBundle/mapping)).

#### Step 3: Define your Elasticsearch types as `Document` objects

[](#step-3-define-your-elasticsearch-types-as-document-objects)

This bundle uses objects to represent Elasticsearch documents. Lets create a `Customer` class for customer document.

```
// src/AppBundle/Document/Customer.php

namespace AppBundle\Document;

use ONGR\ElasticsearchBundle\Annotation as ES;

/**
 * @ES\Document()
 */
class Customer
{
    /**
     * @var string
     *
     * @ES\Id()
     */
    public $id;

    /**
     * @var string
     *
     * @ES\Property(type="text")
     */
    public $name;
}
```

> This is the basic example only, for more information about mapping, please take a look at the [the mapping chapter](http://docs.ongr.io/ElasticsearchBundle/mapping).

#### Step 4: Create index and mappings

[](#step-4-create-index-and-mappings)

Elasticsearch bundle provides several `CLI` commands. One of them is for creating index, run command in your terminal:

```
bin/console ongr:es:index:create
```

> More info about the rest of the commands can be found in the [commands chapter](http://docs.ongr.io/ElasticsearchBundle/commands).

#### Step 5: Enjoy with the Elasticsearch

[](#step-5-enjoy-with-the-elasticsearch)

We advise to take a look at the [mapping chapter](http://docs.ongr.io/ElasticsearchBundle/mapping) to configure the index. Search documentation for the Elasticsearch bundle is [available here](http://docs.ongr.io/ElasticsearchBundle/search). And finally it's up to you what amazing things you are going to create 😎 .

Troubleshooting
---------------

[](#troubleshooting)

- [How to upgrade from the older versions?](http://docs.ongr.io/ElasticsearchBundle/upgrade)
- [How to overwrite some parts of the bundle?](http://docs.ongr.io/ElasticsearchBundle/overwriting_bundle)

License
-------

[](#license)

This bundle is licensed under the MIT license. Please, see the complete license in the bundle `LICENSE` file.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 51.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 ~21 days

Recently: every ~67 days

Total

75

Last Release

2595d ago

Major Versions

v0.10.7 → v1.0.02016-03-17

v0.10.8 → v1.0.22016-05-23

v1.2.6 → v5.0.0-rc12016-11-22

v1.2.8 → v5.0.02017-03-16

1.2.x-dev → v5.0.12017-03-30

PHP version history (5 changes)v0.1.0PHP &gt;=5.4

v1.0.0-alpha.1PHP &gt;=5.5

v5.0.0-rc1PHP ^5.6.6|^7.0

v5.0.0-rc3PHP &gt;=5.6

v5.0.7PHP &gt;=5.6,&lt;7.2

### Community

Maintainers

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

---

Top Contributors

[![saimaz](https://avatars.githubusercontent.com/u/115824?v=4)](https://github.com/saimaz "saimaz (318 commits)")[![einorler](https://avatars.githubusercontent.com/u/13484571?v=4)](https://github.com/einorler "einorler (59 commits)")[![mvar](https://avatars.githubusercontent.com/u/1286752?v=4)](https://github.com/mvar "mvar (42 commits)")[![Zylius](https://avatars.githubusercontent.com/u/5536051?v=4)](https://github.com/Zylius "Zylius (37 commits)")[![linasmo](https://avatars.githubusercontent.com/u/10021248?v=4)](https://github.com/linasmo "linasmo (19 commits)")[![tomaspocevicius](https://avatars.githubusercontent.com/u/2837127?v=4)](https://github.com/tomaspocevicius "tomaspocevicius (16 commits)")[![dvondrak](https://avatars.githubusercontent.com/u/11498368?v=4)](https://github.com/dvondrak "dvondrak (14 commits)")[![juliensantos87](https://avatars.githubusercontent.com/u/1322356?v=4)](https://github.com/juliensantos87 "juliensantos87 (12 commits)")[![asev](https://avatars.githubusercontent.com/u/10020928?v=4)](https://github.com/asev "asev (11 commits)")[![LTRocky](https://avatars.githubusercontent.com/u/4585481?v=4)](https://github.com/LTRocky "LTRocky (11 commits)")[![tautrimas](https://avatars.githubusercontent.com/u/364223?v=4)](https://github.com/tautrimas "tautrimas (10 commits)")[![GrandLTU](https://avatars.githubusercontent.com/u/6538692?v=4)](https://github.com/GrandLTU "GrandLTU (9 commits)")[![nibsirahsieu](https://avatars.githubusercontent.com/u/208039?v=4)](https://github.com/nibsirahsieu "nibsirahsieu (8 commits)")[![ndinh215](https://avatars.githubusercontent.com/u/8800820?v=4)](https://github.com/ndinh215 "ndinh215 (8 commits)")[![chyzas](https://avatars.githubusercontent.com/u/7919897?v=4)](https://github.com/chyzas "chyzas (4 commits)")[![ivannis](https://avatars.githubusercontent.com/u/754477?v=4)](https://github.com/ivannis "ivannis (4 commits)")[![adrienbrault](https://avatars.githubusercontent.com/u/611271?v=4)](https://github.com/adrienbrault "adrienbrault (4 commits)")[![alexander-schranz](https://avatars.githubusercontent.com/u/1698337?v=4)](https://github.com/alexander-schranz "alexander-schranz (3 commits)")[![fattouchsquall](https://avatars.githubusercontent.com/u/1328599?v=4)](https://github.com/fattouchsquall "fattouchsquall (3 commits)")[![kmiladi](https://avatars.githubusercontent.com/u/1974788?v=4)](https://github.com/kmiladi "kmiladi (3 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/grouby-elasticsearch-bundle/health.svg)

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

###  Alternatives

[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M151](/packages/sulu-sulu)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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